geoblacklight 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9b830e90a8580443044e898289baf0c5cf4406256b5d7a559be7feda46b046
4
- data.tar.gz: c8fcc76101713b079a36a8bbb17709b4a8ce4554d2021abaa198e8c501b08434
3
+ metadata.gz: 46c8d4fb0425f7226b0b649f1d1c32b57299b683db1296c7dfb981952e4626d1
4
+ data.tar.gz: 8f64af5a2d95ab6b517860b19db043545eb9a74f7a73aa62ed759473d21449ae
5
5
  SHA512:
6
- metadata.gz: 45b0e722ebb055ecc603e8fa39a8473910aa5a703dfcc8c0d489c6bc490ca840ec2f257adb7ba04ac563fd103912f78a39da8004cebc1bae79df4030c82a249c
7
- data.tar.gz: 3fb12b9e06b472fbc3b87e822644721c151052d0082888e758e27067df1c5e50434d792e3e8f57239ab34dff18eee5778a66ba1e52509562923505c9c111075d
6
+ metadata.gz: 641fbb57de92e4006a757ee6d61f1abb447b4939b9fd86ce7e4bbfcaa4e6129a3d7a48effa6bc3a6c1181aaf061824e382c6b15eba143c25b47302abcc7d84aa
7
+ data.tar.gz: db8fea6b8af4a6749a37c6cddd8ec43088bfeeb03bf16b808d9b1c900cd9a1aabe518af1de0f8b94b4980483d059119ab2f39c93929562c040f9c3e0c12ab7d8
@@ -65,7 +65,7 @@ jobs:
65
65
  run: bundle exec rake ci
66
66
  env:
67
67
  RAILS_VERSION: ${{ matrix.rails_version }}
68
- ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
68
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test --skip-webpack-install --skip-javascript'
69
69
  SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core
70
70
  - name: Upload coverage artifacts
71
71
  uses: actions/upload-artifact@v2
@@ -3,7 +3,7 @@
3
3
  //
4
4
  // <%= vite_client_tag %>
5
5
  // <%= vite_javascript_tag 'application' %>
6
- console.log('Vite ⚡️ Rails')
6
+ console.log('Vite ⚡️ Rails - Engine')
7
7
 
8
8
  // If using a TypeScript entrypoint file:
9
9
  // <%= vite_typescript_tag 'application' %>
@@ -1,4 +1,4 @@
1
- import '@/stylesheets/openlayers.css'
1
+ import '../stylesheets/openlayers.css'
2
2
  import { Map, View } from 'ol'
3
3
  import TileLayer from 'ol/layer/Tile'
4
4
  import VectorTile from 'ol/layer/VectorTile'
@@ -1 +1 @@
1
- @import "node_modules/ol/ol.css";
1
+ @import "../../../node_modules/ol/ol.css";
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency "faraday", "~> 2.0"
24
24
  spec.add_dependency "coderay"
25
25
  spec.add_dependency "deprecation"
26
- spec.add_dependency "geo_combine", "~> 0.8"
26
+ spec.add_dependency "geo_combine", "~> 0.9"
27
27
  spec.add_dependency "mime-types"
28
28
  spec.add_dependency "handlebars_assets"
29
29
  spec.add_dependency "rgeo-geojson"
@@ -116,11 +116,6 @@ module Geoblacklight
116
116
  copy_file "base.html.erb", "app/views/layouts/blacklight/base.html.erb"
117
117
  end
118
118
 
119
- # Vite - Copy config file
120
- def copy_config_vite_json
121
- copy_file "vite.json", "config/vite.json"
122
- end
123
-
124
119
  # Run bundle with vite install
125
120
  def bundle_install
126
121
  Bundler.with_clean_env do
@@ -128,5 +123,21 @@ module Geoblacklight
128
123
  run "bundle exec vite install"
129
124
  end
130
125
  end
126
+
127
+ # Vite - Config files
128
+ def copy_config_vite_json
129
+ copy_file "vite.json", "config/vite.json"
130
+ copy_file "vite.rb", "config/vite.rb"
131
+ copy_file "vite.config.ts", "vite.config.ts"
132
+ copy_file "package.json", "package.json"
133
+
134
+ run "yarn install"
135
+ end
136
+
137
+ # Vite - Copy over the Vite entrypoints
138
+ def copy_vite_entrypoints
139
+ copy_file "clover.js", "app/frontend/entrypoints/clover.js"
140
+ copy_file "ol.js", "app/frontend/entrypoints/ol.js"
141
+ end
131
142
  end
132
143
  end
@@ -0,0 +1,5 @@
1
+ import CloverInitializer from '@gbl/clover/clover_initializer'
2
+
3
+ document.addEventListener('DOMContentLoaded', () => {
4
+ new CloverInitializer().run()
5
+ })
@@ -0,0 +1,5 @@
1
+ import OlInitializer from '@gbl/openlayers/ol_initializer'
2
+
3
+ document.addEventListener('DOMContentLoaded', () => {
4
+ new OlInitializer().run()
5
+ })
@@ -0,0 +1,7 @@
1
+ {
2
+ "devDependencies": {
3
+ "vite": "^5.1.5",
4
+ "vite-plugin-ruby": "^5.0.0",
5
+ "vite-plugin-rails": "^0.5.0"
6
+ }
7
+ }
@@ -0,0 +1,19 @@
1
+ import { defineConfig } from 'vite'
2
+ import rails from 'vite-plugin-rails'
3
+
4
+ export default defineConfig({
5
+ plugins: [
6
+ rails(),
7
+ ],
8
+ // GeoBlacklight: Import assets from arbitrary paths.
9
+ resolve: {
10
+ alias: {
11
+ '@gbl/': `${process.env.GBL_ASSETS_PATH}/`,
12
+ },
13
+ },
14
+ server: {
15
+ fs: {
16
+ allow: [process.env.GBL_ASSETS_PATH!],
17
+ },
18
+ },
19
+ })
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ ViteRuby.env["GBL_ASSETS_PATH"] =
4
+ "#{Gem.loaded_specs["geoblacklight"].full_gem_path}/app/frontend"
@@ -8,33 +8,9 @@ require "geoblacklight/version"
8
8
  require "nokogiri"
9
9
  require "mime/types"
10
10
  require "handlebars_assets"
11
- require "vite_ruby"
12
11
 
13
12
  module Geoblacklight
14
13
  class Engine < ::Rails::Engine
15
- delegate :vite_ruby, to: :class
16
-
17
- def self.vite_ruby
18
- @vite_ruby ||= ViteRuby.new(root: root)
19
- end
20
-
21
- # Expose compiled assets via Rack::Static when running in the host app.
22
- config.app_middleware.use(Rack::Static,
23
- urls: ["/#{vite_ruby.config.public_output_dir}"],
24
- root: root.join(vite_ruby.config.public_dir))
25
-
26
- initializer "vite_rails_engine.proxy" do |app|
27
- if vite_ruby.run_proxy?
28
- app.middleware.insert_before 0, ViteRuby::DevServerProxy, ssl_verify_none: true, vite_ruby: vite_ruby
29
- end
30
- end
31
-
32
- initializer "vite_rails_engine.logger" do
33
- config.after_initialize do
34
- vite_ruby.logger = Rails.logger
35
- end
36
- end
37
-
38
14
  # GeoblacklightHelper is needed by all helpers, so we inject it
39
15
  # into action view base here.
40
16
  initializer "geoblacklight.helpers" do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geoblacklight
4
- VERSION = "4.2.0"
4
+ VERSION = "4.3.0"
5
5
  end
@@ -7,6 +7,15 @@ class TestAppGenerator < Rails::Generators::Base
7
7
 
8
8
  def add_gems
9
9
  gem "blacklight"
10
+
11
+ # In CI, Javascript and Webpacker are removed when generating Rails 6.x
12
+ # applications to enable Vite. Disabling javascript during test app
13
+ # generation removes Turbolinks. This gem is required and needs to be
14
+ # re-added.
15
+ if ENV["RAILS_VERSION"] && Gem::Version.new(ENV["RAILS_VERSION"]) < Gem::Version.new("7.0")
16
+ gem "turbolinks"
17
+ end
18
+
10
19
  Bundler.with_clean_env do
11
20
  run "bundle install"
12
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-02-09 00:00:00.000000000 Z
14
+ date: 2024-03-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -109,14 +109,14 @@ dependencies:
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '0.8'
112
+ version: '0.9'
113
113
  type: :runtime
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0.8'
119
+ version: '0.9'
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: mime-types
122
122
  requirement: !ruby/object:Gem::Requirement
@@ -559,7 +559,6 @@ files:
559
559
  - app/helpers/arcgis_helper.rb
560
560
  - app/helpers/blacklight_helper.rb
561
561
  - app/helpers/carto_helper.rb
562
- - app/helpers/geoblacklight/application_helper.rb
563
562
  - app/helpers/geoblacklight/geoblacklight_helper_behavior.rb
564
563
  - app/helpers/geoblacklight_helper.rb
565
564
  - app/models/concerns/geoblacklight/bbox_filter_field.rb
@@ -626,9 +625,14 @@ files:
626
625
  - lib/generators/geoblacklight/templates/assets/geoblacklight.js
627
626
  - lib/generators/geoblacklight/templates/base.html.erb
628
627
  - lib/generators/geoblacklight/templates/catalog_controller.rb
628
+ - lib/generators/geoblacklight/templates/clover.js
629
+ - lib/generators/geoblacklight/templates/ol.js
630
+ - lib/generators/geoblacklight/templates/package.json
629
631
  - lib/generators/geoblacklight/templates/settings.gbl_v1.yml
630
632
  - lib/generators/geoblacklight/templates/settings.yml
633
+ - lib/generators/geoblacklight/templates/vite.config.ts
631
634
  - lib/generators/geoblacklight/templates/vite.json
635
+ - lib/generators/geoblacklight/templates/vite.rb
632
636
  - lib/geoblacklight.rb
633
637
  - lib/geoblacklight/bounding_box.rb
634
638
  - lib/geoblacklight/constants.rb
@@ -905,7 +909,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
905
909
  - !ruby/object:Gem::Version
906
910
  version: 2.5.2
907
911
  requirements: []
908
- rubygems_version: 3.4.21
912
+ rubygems_version: 3.4.10
909
913
  signing_key:
910
914
  specification_version: 4
911
915
  summary: A discovery platform for geospatial holdings
@@ -1,8 +0,0 @@
1
- module Geoblacklight
2
- module ApplicationHelper
3
- # Override: Returns the engine assets manifest.
4
- def vite_manifest
5
- Geoblacklight::Engine.vite_ruby.manifest
6
- end
7
- end
8
- end