maglevcms 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a26b7ce563ab6178216e954e923de1495b0873799c0035c5d297b201395025b3
4
- data.tar.gz: 5a6c1ee7711d6e1c9817ede3015e4bfbd4db2ac7ed4e295167e6281ed55d6a78
3
+ metadata.gz: 1592154952ea460b1a251f422ff5c2a195671024b1dc7cff35244eb0f22121bc
4
+ data.tar.gz: '09969af10aa25986f2df6c5ce062f57889489befcc9bbd3d6c122a4fc7d70aba'
5
5
  SHA512:
6
- metadata.gz: 30b8ed56ab4ff85ab76afc908155979c5b6dffe80b7208931f16116e9264e5786db978bae12e6a94fe46c4c8b18ff368b591ed000564cefc69fe37b8620094bd
7
- data.tar.gz: ea757185ab81c7f2fc532f20a49c1a0803ed4607ba405d72ff5e3397a15ef72708feaf79f20734c2188d10bee7dc6012889f31a5f4eaa5a2ebaaf6456d99cc6e
6
+ metadata.gz: f3937431f0c1da7bfed8238baf1f1179145b128537ebe82184a99ed659aeaf01b523c836c926cb87800e61cfd21ae119b35eecdde85ace9cb3d10f6d8ddf43d7
7
+ data.tar.gz: a44cf3da138c61c43cdabd1be26c0253242cc3bfeb817bb59d65952ef716c55527138fcba2b76525d19523f8ff4fa8a6cebe095e9fe50154386415aa6b22fd03
data/config/vite.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "all": {
3
3
  "sourceCodeDir": "app/frontend",
4
- "watchAdditionalPaths": []
4
+ "watchAdditionalPaths": [],
5
+ "publicOutputDir": "maglev-assets"
5
6
  },
6
7
  "development": {
7
8
  "autoBuild": true,
8
- "publicOutputDir": "maglev-assets",
9
+ "publicOutputDir": "maglev-assets-dev",
9
10
  "port": 3136
10
11
  },
11
12
  "test": {
12
13
  "autoBuild": true,
13
- "publicOutputDir": "maglev-assets",
14
+ "publicOutputDir": "maglev-assets-test",
14
15
  "port": 3137
15
16
  }
16
17
  }
data/lib/maglev/engine.rb CHANGED
@@ -41,15 +41,25 @@ module Maglev
41
41
  delegate :vite_ruby, to: :class
42
42
 
43
43
  def self.vite_ruby
44
- @vite_ruby ||= ::ViteRuby.new(root: root)
44
+ @vite_ruby ||= ::ViteRuby.new(root: root, mode: Rails.env)
45
45
  end
46
46
 
47
47
  # Serves the engine's vite-ruby when requested
48
48
  initializer 'maglev.vite_rails.static' do |app|
49
- app.middleware.insert_before 0,
50
- Rack::Static,
51
- urls: ["/#{vite_ruby.config.public_output_dir}"],
52
- root: root.join(vite_ruby.config.public_dir)
49
+ if Rails.application.config.public_file_server.enabled
50
+ # this is the right setup when the main application is already
51
+ # using Vite for the theme assets.
52
+ app.middleware.insert_after ActionDispatch::Static,
53
+ Rack::Static,
54
+ urls: ["/#{vite_ruby.config.public_output_dir}"],
55
+ root: root.join(vite_ruby.config.public_dir)
56
+ else
57
+ # mostly when running the application in production behind NGINX or APACHE
58
+ app.middleware.insert_before 0,
59
+ Rack::Static,
60
+ urls: ["/#{vite_ruby.config.public_output_dir}"],
61
+ root: root.join(vite_ruby.config.public_dir)
62
+ end
53
63
  end
54
64
 
55
65
  initializer 'maglev.vite_rails_engine.proxy' do |app|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Maglev
4
- VERSION = '1.1.4'
4
+ VERSION = '1.1.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglevcms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2022-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jbuilder