diff --git a/Gemfile b/Gemfile index 7646597cd..a12407098 100644 --- a/Gemfile +++ b/Gemfile @@ -2,12 +2,9 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 7.1' -# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] -gem "sprockets-rails" +gem "propshaft" # Use Puma as the app server gem 'puma', '~> 6.0' -# Use SCSS for stylesheets -gem 'sassc-rails' gem 'turbo-rails', '~> 2.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes @@ -96,10 +93,8 @@ gem 'ebsco-eds' gem 'sanitize', '~> 6.0' # "optional" dependency as of ebsco-eds 1.1.2 gem 'whenever', require: false # Work around https://github.com/javan/whenever/issues/831 gem 'bitly', '>= 2.0.0.beta' # For bit.ly -gem 'leaflet-rails' # Provides the stylesheet for Leaflet for the StackMap content. gem 'recaptcha', github: 'ambethia/recaptcha', ref: '7866ec44c565a0f164f65066b97347d29a5f343f' # pinned until 5.17 is released gem 'rinku', require: 'rails_rinku' -gem 'bootstrap', '~> 4.0' gem 'rack-attack' # For throttle configuration gem 'global_alerts' gem 'view_component' @@ -111,3 +106,5 @@ gem "jsbundling-rails", "~> 1.2" gem "stimulus-rails", "~> 1.3" + +gem "cssbundling-rails", "~> 1.4" diff --git a/Gemfile.lock b/Gemfile.lock index 59a58babc..012c17116 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,8 +87,6 @@ GEM airbrussh (1.5.1) sshkit (>= 1.6.1, != 1.7.0) ast (2.4.2) - autoprefixer-rails (10.4.16.0) - execjs (~> 2) base64 (0.2.0) bcrypt (3.1.20) bibtex-ruby (6.1.0) @@ -131,10 +129,6 @@ GEM view_component (>= 2.54, < 4) bootsnap (1.18.3) msgpack (~> 1.2) - bootstrap (4.6.2) - autoprefixer-rails (>= 9.1.0) - popper_js (>= 1.16.1, < 2) - sassc-rails (>= 2.0.0) builder (3.2.4) bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) @@ -191,6 +185,8 @@ GEM csl (~> 1.0) css_parser (1.16.0) addressable + cssbundling-rails (1.4.0) + railties (>= 6.0.0) date (3.3.4) debug (1.9.1) irb (~> 1.10) @@ -234,7 +230,6 @@ GEM edtf (3.1.1) activesupport (>= 3.0, < 8.0) erubi (1.12.0) - execjs (2.9.1) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -317,9 +312,6 @@ GEM latex-decode (0.4.0) launchy (2.5.2) addressable (~> 2.8) - leaflet-rails (1.9.4) - actionpack (>= 4.2.0) - railties (>= 4.2.0) letter_opener (1.9.0) launchy (>= 2.2, < 3) library_stdnums (1.6.0) @@ -403,7 +395,11 @@ GEM ast (~> 2.4.1) racc parslet (2.0.0) - popper_js (1.16.1) + propshaft (0.8.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) psych (5.1.2) stringio public_suffix (4.0.7) @@ -536,14 +532,6 @@ GEM sanitize (6.1.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.2) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt scrub_rb (1.0.1) selenium-webdriver (4.18.1) base64 (~> 0.2) @@ -565,13 +553,6 @@ GEM minitar retriable ruby-progressbar - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) sqlite3 (1.7.3-x86_64-darwin) sqlite3 (1.7.3-x86_64-linux) sshkit (1.22.0) @@ -586,7 +567,6 @@ GEM railties (>= 6.0.0) stringio (3.1.0) thor (1.3.1) - tilt (2.3.0) timeout (0.4.1) traject (3.8.2) concurrent-ruby (>= 0.8.0) @@ -651,7 +631,6 @@ DEPENDENCIES blacklight_dynamic_sitemap blacklight_range_limit (~> 8.0) bootsnap - bootstrap (~> 4.0) capistrano (~> 3.0) capistrano-bundler capistrano-passenger @@ -660,6 +639,7 @@ DEPENDENCIES capybara (~> 3.0) coderay config + cssbundling-rails (~> 1.4) debug deprecation devise @@ -674,7 +654,6 @@ DEPENDENCIES jbuilder (~> 2.7) jsbundling-rails (~> 1.2) launchy - leaflet-rails letter_opener mods_display (~> 1.1) mysql2 @@ -682,6 +661,7 @@ DEPENDENCIES nokogiri (>= 1.7.1) okcomputer parslet (~> 2.0) + propshaft puma (~> 6.0) rack-attack rack-mini-profiler (~> 2.0) @@ -699,11 +679,9 @@ DEPENDENCIES rubocop-rspec ruby-oembed sanitize (~> 6.0) - sassc-rails selenium-webdriver simplecov (~> 0.14) solr_wrapper - sprockets-rails sqlite3 stimulus-rails (~> 1.3) turbo-rails (~> 2.0) diff --git a/Procfile.dev b/Procfile.dev index b19ff761b..c1cb24846 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1,3 @@ web: env RUBY_DEBUG_OPEN=true bin/rails server js: yarn build --watch +css: yarn build:css --watch diff --git a/Rakefile b/Rakefile index b1110bb62..dbc119343 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,7 @@ task(:default).clear task default: [:ci] desc "Execute the test build that runs in CI" -task ci: %i[rubocop environment] do +task ci: ['rubocop', 'environment', 'test:prepare'] do require 'solr_wrapper' ENV['environment'] = 'test' diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 05f0adab6..168c2933f 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,6 +1,4 @@ //= link_tree ../images //= link_tree ../fonts //= link application.js -//= link application.css -//= link print.css //= link_tree ../builds diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.sass.scss similarity index 55% rename from app/assets/stylesheets/application.scss rename to app/assets/stylesheets/application.sass.scss index 77741900b..3bc9ece07 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -1,8 +1,5 @@ -/* -* Used by blacklight_range_limit -*= require 'blacklight_range_limit' -*= require leaflet -*/ +@import 'blacklight-range-limit/app/assets/stylesheets/blacklight_range_limit.css'; +@import 'leaflet/dist/leaflet.css'; // SUL Style Variables/Mixins @import 'deja-vu-font'; @@ -11,6 +8,6 @@ @import 'blacklight'; @import 'searchworks'; -@import 'font-awesome'; +@import 'font-awesome/scss/font-awesome.scss'; @import '_sul-icons-rails'; @import 'bootstrap-icons'; diff --git a/app/assets/stylesheets/blacklight.scss b/app/assets/stylesheets/blacklight.scss index 4ebf055c0..8a1d85657 100644 --- a/app/assets/stylesheets/blacklight.scss +++ b/app/assets/stylesheets/blacklight.scss @@ -1,13 +1,13 @@ @import 'bootstrap-variables'; -@import 'bootstrap'; +@import 'bootstrap/scss/bootstrap.scss'; @import 'bootstrap-mixins'; @import 'bootstrap-overrides'; -@import 'blacklight/blacklight'; +@import 'blacklight-frontend/app/assets/stylesheets/blacklight/blacklight.scss'; @import 'blacklight_marc'; -@import 'blacklight/hierarchy/hierarchy'; +@import 'blacklight-hierarchy/app/assets/stylesheets/blacklight/hierarchy/hierarchy.scss'; // the default bootstrap font-family list includes "Segoe UI Emoji", which, on windows // renders our remove icon as an emoji-sized x instead of what we see on all other platforms... diff --git a/app/views/layouts/searchworks.html.erb b/app/views/layouts/searchworks.html.erb index 16f54e642..78f72facb 100644 --- a/app/views/layouts/searchworks.html.erb +++ b/app/views/layouts/searchworks.html.erb @@ -13,7 +13,7 @@ <%= render_page_title %> <%= opensearch_description_tag I18n.t('blacklight.application_name'), opensearch_catalog_path(format: 'xml') %> <%= favicon_link_tag 'favicon.ico' %> - <%= stylesheet_link_tag "application", media: "all" %> + <%= stylesheet_link_tag "application", media: "all", 'data-turbo-track' => true %> <%= stylesheet_link_tag 'print', media: 'print' %> diff --git a/package.json b/package.json index bfee55f90..f11d8de04 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,17 @@ "@hotwired/turbo-rails": "^8.0.0", "blacklight-frontend": "7", "blacklight-hierarchy": "^6.1.2", - "blacklight-range-limit": "^8.3.0", + "blacklight-range-limit": "^8.5.0", "bootstrap": "4", "esbuild": "^0.19.4", "fetch-jsonp": "^1.3.0", + "font-awesome": "^4.7", "leaflet": "1", - "popper.js": "1" + "popper.js": "1", + "sass": "^1.72.0" }, "scripts": { - "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets" + "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets", + "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/print.scss:./app/assets/builds/print.css --no-source-map --load-path=node_modules" } } diff --git a/yarn.lock b/yarn.lock index 1354e3196..2a56bd776 100644 --- a/yarn.lock +++ b/yarn.lock @@ -140,6 +140,19 @@ resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.1.3.tgz#4db480347775aeecd4dde2405659eef74a458881" integrity sha512-ojNvnoZtPN0pYvVFtlO7dyEN9Oml1B6IDM+whGKVak69MMYW99lC2NOWXWeE3bmwEydbP/nn6ERcpfjHVjYQjA== +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + blacklight-frontend@7, "blacklight-frontend@>=7.1 || 8.0": version "7.37.0" resolved "https://registry.yarnpkg.com/blacklight-frontend/-/blacklight-frontend-7.37.0.tgz#cbc2e744ebf1728546e3f6a6b0033fe36227d4e0" @@ -157,7 +170,7 @@ blacklight-hierarchy@^6.1.2: blacklight-frontend ">=7.1 || 8.0" jquery ">=3.0" -blacklight-range-limit@^8.3.0: +blacklight-range-limit@^8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/blacklight-range-limit/-/blacklight-range-limit-8.5.0.tgz#91980e8e88a921b4703b2de23dded8653bfcdc71" integrity sha512-SOiHzdQ5HUJQqZHH9Wzhzbn6wgDpVZ8kGZUkF1J1PadSWTnAANQbxHZtazLgTU1SMFC3gYcty4tGrMYecTJ+gA== @@ -172,6 +185,28 @@ bootstrap@4: resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.3.tgz#de35e1a765c897ac940021900fcbb831602bac38" integrity sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg== +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +"chokidar@>=3.0.0 <4.0.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + esbuild@^0.19.4: version "0.19.12" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04" @@ -206,6 +241,59 @@ fetch-jsonp@^1.3.0: resolved "https://registry.yarnpkg.com/fetch-jsonp/-/fetch-jsonp-1.3.0.tgz#99b8c25bd100938d7a7a6b5db9d6b81f32a10809" integrity sha512-hxCYGvmANEmpkHpeWY8Kawfa5Z1t2csTpIClIDG/0S92eALWHRU1RnGaj86Tf5Cc0QF+afSa4SQ4pFB2rFM5QA== +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +font-awesome@^4.7: + version "4.7.0" + resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" + integrity sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg== + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +immutable@^4.0.0: + version "4.3.5" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.5.tgz#f8b436e66d59f99760dc577f5c99a4fd2a5cc5a0" + integrity sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + jquery@>=1.7, jquery@>=3.0, jquery@^3.5.1: version "3.7.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" @@ -216,11 +304,49 @@ leaflet@1: resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d" integrity sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA== +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + popper.js@1: version "1.16.1" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +sass@^1.72.0: + version "1.72.0" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.72.0.tgz#5b9978943fcfb32b25a6a5acb102fc9dabbbf41c" + integrity sha512-Gpczt3WA56Ly0Mn8Sl21Vj94s1axi9hDIzDFn9Ph9x3C3p4nNyvsqJoQyVXKou6cBlfFWEgRW4rT8Tb4i3XnVA== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + +"source-map-js@>=0.6.2 <2.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + typeahead.js@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/typeahead.js/-/typeahead.js-0.11.1.tgz#4e64e671b22310a8606f4aec805924ba84b015b8"