vite_ruby 1.2.13 → 1.2.14

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: ab9424e5c414c6c857c3e2b9fdeacbff44e5cdc7b39229085ff515f56e02b659
4
- data.tar.gz: 2cc6fbd84be485d474d019f1e1767cb38bb34078066e551a449bd371cdc1d0bf
3
+ metadata.gz: 7e80047ce42401b79a4aff5e69073a89673df7204100e0ce27f618fe26c5ef69
4
+ data.tar.gz: 1acdf0bce6287c9736e45439e53ee714fd3cd0f7d26c287f732595f33f21982f
5
5
  SHA512:
6
- metadata.gz: 8d08d31fe3266b032b9c81b61325b947883ae4435ca9df7038aa1e41d6382763169525d53acb4e52d7b3dd895b40aa923ed5248950ae2007380b767ed8f2f581
7
- data.tar.gz: f109af25dd73336fc23685a3ad879d5b44cd2d9bcaf1523e427f4cb63aa9f950ad1d23462e8e4bddd4e9834e0f4c222d1a6d05d335bbead4dcb594686e05ea51
6
+ metadata.gz: dcafb3d610855ecdc44c0a0d85fb48af5ced7c302b95f596094e75346b4cc78746a43bcfd539575e3a392e87bd2dbc55d34a26844886e9846e8491e1e8d28298
7
+ data.tar.gz: 2a40d1769bb463fca1274ab1cc4cce3ebe1cdcc96c172a1eeebdbcab5a6fc40fb19cd45dc959ad4079f82b23d3fbb0909ec126f85be3a3f11a04c109ca2d3b19
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.2.14](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.13...vite_ruby@1.2.14) (2021-07-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add support for Jekyll installer ([7b942ec](https://github.com/ElMassimo/vite_ruby/commit/7b942ec745eb28092d684056b02df675ad6ececa))
7
+
8
+
9
+
1
10
  ## [1.2.13](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.12...vite_ruby@1.2.13) (2021-06-30)
2
11
 
3
12
 
data/lib/vite_ruby.rb CHANGED
@@ -21,8 +21,16 @@ class ViteRuby
21
21
  DEFAULT_VITE_VERSION = '^2.2.3'
22
22
  DEFAULT_PLUGIN_VERSION = '^2.0.2'
23
23
 
24
- # Internal: Ruby Frameworks that have a companion library for Vite Ruby.
25
- SUPPORTED_FRAMEWORKS = %w[rails hanami roda padrino sinatra].freeze
24
+ # Internal: Companion libraries for Vite Ruby, and their target framework.
25
+ COMPANION_LIBRARIES = {
26
+ 'vite_rails' => 'rails',
27
+ 'vite_hanami' => 'hanami',
28
+ 'vite_roda' => 'roda',
29
+ 'vite_padrino' => 'padrino',
30
+ 'vite_sinatra' => 'sinatra',
31
+ 'jekyll-vite' => 'jekyll',
32
+ 'vite_rails_legacy' => 'rails',
33
+ }
26
34
 
27
35
  class << self
28
36
  extend Forwardable
@@ -72,8 +80,8 @@ class ViteRuby
72
80
  # Internal: Detects if the application has installed a framework-specific
73
81
  # variant of Vite Ruby.
74
82
  def framework_libraries
75
- SUPPORTED_FRAMEWORKS.map { |framework|
76
- if library = (Gem.loaded_specs["vite_#{ framework }"] || Gem.loaded_specs["vite_#{ framework }_legacy"])
83
+ COMPANION_LIBRARIES.map { |name, framework|
84
+ if library = Gem.loaded_specs[name]
77
85
  [framework, library]
78
86
  end
79
87
  }.compact
@@ -28,6 +28,14 @@ class ViteRuby::CLI::Install < Dry::CLI::Command
28
28
 
29
29
  protected
30
30
 
31
+ # Internal: The JS packages that should be added to the app.
32
+ def js_dependencies
33
+ [
34
+ "vite@#{ ViteRuby::DEFAULT_VITE_VERSION }",
35
+ "vite-plugin-ruby@#{ ViteRuby::DEFAULT_PLUGIN_VERSION }",
36
+ ]
37
+ end
38
+
31
39
  # Internal: Setup for a plain Rack application.
32
40
  def setup_app_files
33
41
  copy_template 'config/vite.json', to: config.config_path
@@ -73,7 +81,7 @@ private
73
81
  write(package_json, '{}') unless package_json.exist?
74
82
 
75
83
  Dir.chdir(root) do
76
- deps = "vite@#{ ViteRuby::DEFAULT_VITE_VERSION } vite-plugin-ruby@#{ ViteRuby::DEFAULT_PLUGIN_VERSION }"
84
+ deps = js_dependencies.join(' ')
77
85
  _, stderr, status = ViteRuby::IO.capture("npx --package @antfu/ni -- ni -D #{ deps }", stdin_data: "\n")
78
86
  _, stderr, = ViteRuby::IO.capture("yarn add -D #{ deps }") unless status.success?
79
87
  say("Could not install JS dependencies.\n", stderr) unless stderr.to_s.empty?
@@ -117,5 +125,5 @@ end
117
125
 
118
126
  # NOTE: This allows framework-specific variants to extend the installation.
119
127
  ViteRuby.framework_libraries.each do |_framework, library|
120
- require "#{ library.name }/installation"
128
+ require "#{ library.name.tr('-', '/') }/installation"
121
129
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '1.2.13'
4
+ VERSION = '1.2.14'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.13
4
+ version: 1.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -198,8 +198,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
198
198
  licenses:
199
199
  - MIT
200
200
  metadata:
201
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@1.2.13/vite_ruby
202
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@1.2.13/vite_ruby/CHANGELOG.md
201
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@1.2.14/vite_ruby
202
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@1.2.14/vite_ruby/CHANGELOG.md
203
203
  post_install_message:
204
204
  rdoc_options: []
205
205
  require_paths: