vite_rails 2.0.1 → 2.0.2

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: 6208a1cb77ee1f6925ddbadd6cec33e701e80f3cd5420158a126fce303abb262
4
- data.tar.gz: fa1869355b55195682d551c040a0c477eae02682b83f6e983404973b8f735a8a
3
+ metadata.gz: 3af3f9fbccd64b18370496ed29bf4314468c29c3cc357439686dca4cb2d7b583
4
+ data.tar.gz: 1ff2bff5ec79f12b1fa6b08822327b1402900833c9331746427d973d997f7470
5
5
  SHA512:
6
- metadata.gz: bd4acb9dec8d3d3085ab544bf123ca86057043dba159dcc25e94743270b343a3def30e6261fe3631f539c2976d7aa97255a10bd229c37b2db8d23447c560e739
7
- data.tar.gz: 38d22b44d55d01effc1cf3874e32de3d6139de5d355a4fde5a87f79d17aba181ced333ec92cfba937ef73cc0ff42af9a1b9d846dc09cc71030971150d5a0cc61
6
+ metadata.gz: eea23ceec95f3a623a2812a81f28738343e79d43bdf80581a2dbcb8a4e1e2aa95a93b33de17e25170b037695a775a386ad7c151885ba9dd27c398b772b9caf8a
7
+ data.tar.gz: 5eeb0f3be3d39d8e03b4e9870ac52777641010c672061cf7033ade3120560a0feaf0b9f0755b0136801b8cea44cdb780b24ec8f72e5866a282a4b54a7cceea9d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Vite Rails 2.0.2 (2020-02-11)
2
+
3
+ - Automatically infer `app/javascript` as the `sourceCodeDir` if it exists.
4
+
1
5
  ## Vite Rails 2.0.1 (2020-02-11)
2
6
 
3
7
  - Add the CSP rules commented out when installing, in case the user hasn't uncommented them yet.
@@ -10,6 +10,9 @@ module ViteRails::Installation
10
10
  # Override: Setup a typical apps/web Hanami app to use Vite.
11
11
  def setup_app_files
12
12
  cp RAILS_TEMPLATES.join('config/rails-vite.json'), config.config_path
13
+ if root.join('app/javascript').exist?
14
+ Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "app/javascript",)
15
+ end
13
16
  setup_content_security_policy root.join('config/initializers/content_security_policy.rb')
14
17
  end
15
18
 
@@ -33,7 +36,9 @@ module ViteRails::Installation
33
36
 
34
37
  # Override: Create a sample JS file and attempt to inject it in an HTML template.
35
38
  def install_sample_files
36
- cp RAILS_TEMPLATES.join('entrypoints/application.js'), config.resolved_entrypoints_dir.join('application.js')
39
+ unless config.resolved_entrypoints_dir.join('application.js').exist?
40
+ cp RAILS_TEMPLATES.join('entrypoints/application.js'), config.resolved_entrypoints_dir.join('application.js')
41
+ end
37
42
 
38
43
  if (layout_file = root.join('app/views/layouts/application.html.erb')).exist?
39
44
  inject_line_before layout_file, '</head>', <<-HTML
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
@@ -118,8 +118,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
118
118
  licenses:
119
119
  - MIT
120
120
  metadata:
121
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.1/vite_rails
122
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.1/vite_rails/CHANGELOG.md
121
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.2/vite_rails
122
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.2/vite_rails/CHANGELOG.md
123
123
  post_install_message:
124
124
  rdoc_options: []
125
125
  require_paths: