vite_ruby 3.0.1 → 3.0.5

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: 9606e4636341971487203132916240e61c6f78de01009ee2cc001ad8cc13f12a
4
- data.tar.gz: 521ccded8cafa3b17ae62408650c0673c78b1441fc669532b240555702b51642
3
+ metadata.gz: 6279172f955f9ca8f6a545a9c48835978d6b3329d9a19cbfe58333d8938a49aa
4
+ data.tar.gz: 866f2cb6d3525a5e0f2b96e302d21919c5d32938e03bf8e03de9cdfe9126603b
5
5
  SHA512:
6
- metadata.gz: b903a283f653cd02e89272174d66efd5991266c174418e978ed680205ea703d2d2a9384b16a155618788eaaae3748cb900eeca5b354e3e4277de7709a7784605
7
- data.tar.gz: 60e731442205c932f7033317ea75651370474ae419d70f6204fa59059be61d54f472f583d136d93672167ac0777d049a229928f79896b6a96448525b44e5be83
6
+ metadata.gz: e281804897b5a583ee7f3b3e76d3ac4c36df10de19c5d14fc56bf09bd12537704acf50bd95f937e4f0fe17c10c78e1c5d131112e29ba1d5e45a0dfbb32d7f3bd
7
+ data.tar.gz: a7c8e59b77ce3ce3b1de7e98198da7a367140f8844411dcb1048faeaa3dd680f32c7fda1b5d60e4c2c0c637a9a196b36ce9528ef4f0108e6683fc1b2b0bcb007
data/CHANGELOG.md CHANGED
@@ -1,3 +1,47 @@
1
+ ## [3.0.5](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.4...vite_ruby@3.0.5) (2021-12-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ensure vite_plugin_legacy is upgraded by the upgrade command ([2f9437d](https://github.com/ElMassimo/vite_ruby/commit/2f9437d248e27aa03b5b8a1df3e3d6a52c791cd1))
7
+
8
+
9
+
10
+ ## [3.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.3...vite_ruby@3.0.4) (2021-12-17)
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * if using `vite_plugin_legacy`, make sure to upgrade to 3.0.1
15
+
16
+ ### Bug Fixes
17
+
18
+ * handle new virtual legacy-polyfill name ([#157](https://github.com/ElMassimo/vite_ruby/issues/157)) ([a34e77f](https://github.com/ElMassimo/vite_ruby/commit/a34e77f3b342c9171adc50adfd5220b57bddb961))
19
+
20
+
21
+ ## [3.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.2...vite_ruby@3.0.3) (2021-12-09)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * ensure bundler does not keep generating binstubs ([0dc133a](https://github.com/ElMassimo/vite_ruby/commit/0dc133a23f6caa5526fc071e0afd98f91fc1f9f6))
27
+ * explicitly require socket to enable usage in bare ruby ([cf22165](https://github.com/ElMassimo/vite_ruby/commit/cf22165fa3cc58df4c52bed154372abef4f3eff1))
28
+
29
+
30
+ ### Features
31
+
32
+ * add 'base' setting ([#152](https://github.com/ElMassimo/vite_ruby/issues/152)) ([fb7642f](https://github.com/ElMassimo/vite_ruby/commit/fb7642f849b7fe879c02e543962a72dcc1b1c48c))
33
+
34
+
35
+
36
+ ## [3.0.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.1...vite_ruby@3.0.2) (2021-10-29)
37
+
38
+
39
+ ### Features
40
+
41
+ * enable hmr when running tests in development with vite dev server ([e253bba](https://github.com/ElMassimo/vite_ruby/commit/e253bba26d164aabc7a9526df504c207ad2cf6f9))
42
+
43
+
44
+
1
45
  ## [3.0.1](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.0...vite_ruby@3.0.1) (2021-10-27)
2
46
 
3
47
 
data/default.vite.json CHANGED
@@ -16,5 +16,6 @@
16
16
  "port": 3036,
17
17
  "hideBuildConsoleOutput": false,
18
18
  "viteBinPath": "node_modules/.bin/vite",
19
- "watchAdditionalPaths": []
19
+ "watchAdditionalPaths": [],
20
+ "base": ""
20
21
  }
@@ -63,6 +63,7 @@ class ViteRuby::Commands
63
63
  # Internal: Installs the binstub for the CLI in the appropriate path.
64
64
  def install_binstubs
65
65
  `bundle binstub vite_ruby --path #{ config.root.join('bin') }`
66
+ `bundle config --delete bin`
66
67
  end
67
68
 
68
69
  # Internal: Verifies if ViteRuby is properly installed.
@@ -147,9 +147,10 @@ private
147
147
 
148
148
  # Internal: Resolves the manifest entry name for the specified resource.
149
149
  def resolve_entry_name(name, type: nil)
150
- name = with_file_extension(name.to_s, type)
150
+ return resolve_virtual_entry(name) if type == :virtual
151
151
 
152
- raise ArgumentError, "Asset names can not be relative. Found: #{ name }" if name.start_with?('.') && !name.include?('legacy-polyfills')
152
+ name = with_file_extension(name.to_s, type)
153
+ raise ArgumentError, "Asset names can not be relative. Found: #{ name }" if name.start_with?('.')
153
154
 
154
155
  # Explicit path, relative to the source_code_dir.
155
156
  name.sub(%r{^~/(.+)$}) { return Regexp.last_match(1) }
@@ -171,6 +172,11 @@ private
171
172
  end
172
173
  end
173
174
 
175
+ # Internal: Resolves a virtual entry by walking all the manifest keys.
176
+ def resolve_virtual_entry(name)
177
+ manifest.keys.find { |file| file.include?(name) } || name
178
+ end
179
+
174
180
  # Internal: Adds a file extension to the file name, unless it already has one.
175
181
  def with_file_extension(name, entry_type)
176
182
  if File.extname(name).empty? && (ext = extension_for_type(entry_type))
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.5'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
7
  DEFAULT_VITE_VERSION = '^2.6.13'
data/lib/vite_ruby.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'logger'
4
4
  require 'forwardable'
5
5
  require 'pathname'
6
+ require 'socket'
6
7
 
7
8
  require 'zeitwerk'
8
9
  loader = Zeitwerk::Loader.for_gem
@@ -26,6 +27,7 @@ class ViteRuby
26
27
  'vite_padrino' => 'padrino',
27
28
  'jekyll-vite' => 'jekyll',
28
29
  'vite_rails_legacy' => 'rails',
30
+ 'vite_plugin_legacy' => 'rack',
29
31
  }
30
32
 
31
33
  class << self
@@ -97,7 +99,7 @@ class ViteRuby
97
99
 
98
100
  # Public: The proxy for assets should only run in development mode.
99
101
  def run_proxy?
100
- config.mode == 'development'
102
+ config.mode == 'development' || (config.mode == 'test' && !ENV['CI'])
101
103
  rescue StandardError => error
102
104
  logger.error("Failed to check mode for Vite: #{ error.message }")
103
105
  false
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "test": {
12
12
  "autoBuild": true,
13
- "publicOutputDir": "vite-test"
13
+ "publicOutputDir": "vite-test",
14
+ "port": 3037
14
15
  }
15
16
  }
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: 3.0.1
4
+ version: 3.0.5
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-10-27 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -201,8 +201,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
201
201
  licenses:
202
202
  - MIT
203
203
  metadata:
204
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.1/vite_ruby
205
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.1/vite_ruby/CHANGELOG.md
204
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.5/vite_ruby
205
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.5/vite_ruby/CHANGELOG.md
206
206
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
207
207
  manually, please run:\n\tbundle exec vite upgrade"
208
208
  rdoc_options: []