diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e74c05e..3230fe23 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,4 +81,4 @@ jobs: POSTGRES_PASSWORD: postgres PGPORT: ${{ job.services.postgres.ports[5432] }} RAILS_ENV: test - run: bundle exec rspec + run: bundle exec rake spec diff --git a/.gitignore b/.gitignore index 2972874c..4b18d4ff 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,8 @@ yarn-debug.log* /storage/* !/storage/.keep all_sorns.code-workspace + +/app/assets/builds/* +!/app/assets/builds/.keep + +/node_modules diff --git a/Gemfile b/Gemfile index 1c90a46c..4958db2d 100644 --- a/Gemfile +++ b/Gemfile @@ -5,10 +5,7 @@ ruby '~> 3.2' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -# We need to use rails 6-1.stable to get around a problem with good_job: -# https://github.com/bensheldon/good_job/issues/1016#issuecomment-1644915406 -gem 'rails', github: "rails/rails", branch: '6-1-stable' -# gem 'rails', '~> 6.1', '>= 6.1.7.8' +gem 'rails', '~> 7.0.0' gem 'good_job', '~> 4.0' gem 'pg' gem 'httparty' @@ -25,10 +22,9 @@ gem 'csv' # Use Puma as the app server gem 'puma', '~> 6.4' -# Use SCSS for stylesheets -gem 'sass-rails', '~> 6.0' -# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker -gem 'webpacker', '~> 5.4', '>= 5.4.4' +gem 'sass-rails' +gem 'sprockets-rails' +gem 'jsbundling-rails' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.12' @@ -46,19 +42,9 @@ group :development, :test do gem 'factory_bot_rails', '~> 6.4' end -group :development do - # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'web-console', '>= 4.2.1' - gem 'listen', '~> 3.9' - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' - gem 'spring-watcher-listen', '~> 2.1.0' -end - group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '~> 3.40' - gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers', '~> 5.3' gem 'launchy' diff --git a/Gemfile.lock b/Gemfile.lock index be516a92..0eee6584 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,104 +1,77 @@ -GIT - remote: https://github.com/rails/rails.git - revision: 959037fa483f4fa65a06f61db9653381d51f073b - branch: 6-1-stable +GEM + remote: https://rubygems.org/ specs: - actioncable (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) + actioncable (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + actionmailbox (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (>= 2.7.1) - actionmailer (6.1.7.8) - actionpack (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activesupport (= 6.1.7.8) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.4) + actionpack (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.8) - actionview (= 6.1.7.8) - activesupport (= 6.1.7.8) - racc - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8.4) + actionview (= 7.0.8.4) + activesupport (= 7.0.8.4) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.8) - actionpack (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + actiontext (7.0.8.4) + actionpack (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.8) - activesupport (= 6.1.7.8) + actionview (7.0.8.4) + activesupport (= 7.0.8.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.8) - activesupport (= 6.1.7.8) + activejob (7.0.8.4) + activesupport (= 7.0.8.4) globalid (>= 0.3.6) - activemodel (6.1.7.8) - activesupport (= 6.1.7.8) - activerecord (6.1.7.8) - activemodel (= 6.1.7.8) - activesupport (= 6.1.7.8) - activestorage (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activesupport (= 6.1.7.8) + activemodel (7.0.8.4) + activesupport (= 7.0.8.4) + activerecord (7.0.8.4) + activemodel (= 7.0.8.4) + activesupport (= 7.0.8.4) + activestorage (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activesupport (= 7.0.8.4) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.8) - base64 - bigdecimal + activesupport (7.0.8.4) concurrent-ruby (~> 1.0, >= 1.0.2) - drb i18n (>= 1.6, < 2) minitest (>= 5.1) - mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - rails (6.1.7.8) - actioncable (= 6.1.7.8) - actionmailbox (= 6.1.7.8) - actionmailer (= 6.1.7.8) - actionpack (= 6.1.7.8) - actiontext (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activemodel (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) - bundler (>= 1.15.0) - railties (= 6.1.7.8) - sprockets-rails (>= 2.0.0) - railties (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) - method_source - rake (>= 12.2) - thor (~> 1.0) - -GEM - remote: https://rubygems.org/ - specs: addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) base64 (0.2.0) bigdecimal (3.1.8) - bindex (0.8.1) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) bootsnap (1.18.3) msgpack (~> 1.2) builder (3.3.0) @@ -118,9 +91,8 @@ GEM crass (1.0.6) csv (3.3.0) date (3.3.4) - debug_inspector (1.1.0) + debug_inspector (1.2.0) diff-lcs (1.5.1) - drb (2.2.1) erubi (1.13.0) et-orbi (1.2.11) tzinfo @@ -132,7 +104,6 @@ GEM federal_register (0.7.7) httparty (>= 0.14.0) ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-linux-gnu) fugit (1.11.0) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) @@ -155,6 +126,8 @@ GEM jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) + jsbundling-rails (1.3.0) + railties (>= 6.0.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -170,9 +143,6 @@ GEM launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) - listen (3.9.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -220,16 +190,28 @@ GEM pry-stack_explorer (0.6.1) binding_of_caller (~> 1.0) pry (~> 0.13) - public_suffix (6.0.0) + public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.0) rack (2.2.9) - rack-proxy (0.7.7) - rack rack-test (2.1.0) rack (>= 1.3) + rails (7.0.8.4) + actioncable (= 7.0.8.4) + actionmailbox (= 7.0.8.4) + actionmailer (= 7.0.8.4) + actionpack (= 7.0.8.4) + actiontext (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activemodel (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) + bundler (>= 1.15.0) + railties (= 7.0.8.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -237,10 +219,14 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) + railties (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) rake (13.2.1) - rb-fsevent (0.11.2) - rb-inotify (0.11.1) - ffi (~> 1.0) regexp_parser (2.9.2) rexml (3.3.2) strscan @@ -280,11 +266,6 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - semantic_range (3.0.0) - spring (4.2.1) - spring-watcher-listen (2.1.0) - listen (>= 2.7, < 4.0) - spring (>= 4) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -294,25 +275,15 @@ GEM sprockets (>= 3.0.0) strscan (3.1.0) thor (1.3.1) - tilt (2.3.0) + tilt (2.4.0) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - web-console (4.2.1) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) - bindex (>= 0.4.0) - railties (>= 6.0.0) webdrivers (5.3.1) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - webpacker (5.4.4) - activesupport (>= 5.2) - rack-proxy (>= 0.6.1) - railties (>= 5.2) - semantic_range (>= 2.3.0) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -336,9 +307,9 @@ DEPENDENCIES good_job (~> 4.0) httparty jbuilder (~> 2.12) + jsbundling-rails kaminari (~> 1.2) launchy - listen (~> 3.9) mutex_m pg pg_search @@ -346,18 +317,14 @@ DEPENDENCIES pry-rescue pry-stack_explorer puma (~> 6.4) - rails! + rails (~> 7.0.0) rexml rspec-rails (~> 6.1) - sass-rails (~> 6.0) + sass-rails saxerator scenic (~> 1.8) - selenium-webdriver - spring - spring-watcher-listen (~> 2.1.0) - web-console (>= 4.2.1) + sprockets-rails webdrivers (~> 5.3) - webpacker (~> 5.4, >= 5.4.4) RUBY VERSION ruby 3.2.2p53 diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 00000000..b19ff761 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +web: env RUBY_DEBUG_OPEN=true bin/rails server +js: yarn build --watch diff --git a/app/assets/builds/.keep b/app/assets/builds/.keep new file mode 100644 index 00000000..e69de29b diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 59181933..338a0e82 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,2 +1,3 @@ //= link_tree ../images //= link_directory ../stylesheets .css +//= link_tree ../builds diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 00000000..2adcb666 --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,10 @@ +// Entry point for the build script in your package.json + +require("@rails/ujs").start() +window.$ = require("jquery") + +window.dataLayer = window.dataLayer || []; +function gtag(){dataLayer.push(arguments);} +gtag('js', new Date()); + +gtag('config', 'G-QZ9W5STPKJ'); diff --git a/app/javascript/packs/beforeSearch.js b/app/javascript/beforeSearch.js similarity index 100% rename from app/javascript/packs/beforeSearch.js rename to app/javascript/beforeSearch.js diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js deleted file mode 100644 index fa4fb4dc..00000000 --- a/app/javascript/packs/application.js +++ /dev/null @@ -1,22 +0,0 @@ -// This file is automatically compiled by Webpack, along with any other files -// present in this directory. You're encouraged to place your actual application logic in -// a relevant structure within app/javascript and only use these pack files to reference -// that code so it'll be compiled. - -require("@rails/ujs").start() -require("jquery") - -window.dataLayer = window.dataLayer || []; -function gtag(){dataLayer.push(arguments);} -gtag('js', new Date()); - -gtag('config', 'G-QZ9W5STPKJ'); - - - -// Uncomment to copy all static images under ../images to the output folder and reference -// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) -// or the `imagePath` JavaScript helper below. -// -// const images = require.context('../images', true) -// const imagePath = (name) => images(name, true) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 731ae93a..4c5222a3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -15,7 +15,7 @@ <%= stylesheet_link_tag 'application', media: 'all' %> - <%= javascript_pack_tag 'application' %> + <%= javascript_include_tag "application", type: "module" %> <%= content_for :search %> diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 45819a2b..6ad4d136 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -1,5 +1,5 @@ <% content_for :search do %> - <%= javascript_pack_tag 'beforeSearch' %> + <%= javascript_include_tag "beforeSearch", type: "module" %> <% end %>
@@ -16,7 +16,7 @@