vite_ruby 3.3.1 → 3.3.3

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: db8bbdf902948aeeae6bc1fd6557d90897a9ce6d1d728892b1a9cdab790f1e23
4
- data.tar.gz: 6aa03cc0b843a0162e6f9467d6a895d33ad95c2818bd0bf6743af01f4fc5432b
3
+ metadata.gz: b261ed4c2d3d2653bc218492a4507b17e45d34a4988fe974b6f1f6b5cb1edce3
4
+ data.tar.gz: ed8074ec0a226b8814b22b8dbc494c2a927acc0c08d96219bcee97e044b7de0d
5
5
  SHA512:
6
- metadata.gz: b79881fde19bd9935f4f1d0dd19428413aec482622391ef9930c83188e87a4db26fc93b26a8fa8f4c5de1df378b9f331b19ec991e9c7872f04f5911a3449484e
7
- data.tar.gz: 0020fe5ad366a4956d4eff472718e9df850bafadfa380cc3745e1c164fc03e8fcd3df6e1043f1c9f581ec7dfdfbe538461681ccc5c403ad0cf2db335786a4ff7
6
+ metadata.gz: d49d7a773da0ad3f5766b045d333ac04e84f3fc61bfe94af473c45f1aeda1a2070dc6d8319fc4e051ed18b598286b35ff295e80d6c26d09c7485a2d6df4c41f6
7
+ data.tar.gz: d1bce21f1be30d5beb653d73ff999475939affcd93db82734560979ca1a2a5413498ef9ec948ae036273bd1946ce9c0113e4607a38cc2e78f6d2f3f0e50309b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [3.3.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.2...vite_ruby@3.3.3) (2023-06-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * allow skipping dev dependencies on install ([#374](https://github.com/ElMassimo/vite_ruby/issues/374)) ([a309f4f](https://github.com/ElMassimo/vite_ruby/commit/a309f4f9fc62fb7b9d0728b66b30ad90e68ba7bf))
7
+ * Use javascript_tag helper for vite_react_refresh_tag ([#372](https://github.com/ElMassimo/vite_ruby/issues/372)) ([238c6bd](https://github.com/ElMassimo/vite_ruby/commit/238c6bd211c0fafaa6170f0bdd631a0f6e41d992)), closes [#249](https://github.com/ElMassimo/vite_ruby/issues/249)
8
+
9
+
10
+
11
+ ## [3.3.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.1...vite_ruby@3.3.2) (2023-05-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * ensure assets:precompile task is displayed when using `rake -T` ([66af6eb](https://github.com/ElMassimo/vite_ruby/commit/66af6eb0268e7a989562feb38da74072817f0d49))
17
+
18
+
19
+
1
20
  ## [3.3.1](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.0...vite_ruby@3.3.1) (2023-04-28)
2
21
 
3
22
 
data/lib/tasks/vite.rake CHANGED
@@ -42,11 +42,11 @@ namespace :vite do
42
42
 
43
43
  desc 'Ensure build dependencies like Vite are installed before bundling'
44
44
  task :install_dependencies do
45
+ install_env_args = ENV['VITE_RUBY_SKIP_INSTALL_DEV_DEPENDENCIES'] == 'true' ? {} : { 'NODE_ENV' => 'development' }
45
46
  cmd = ViteRuby.commands.legacy_npm_version? ? 'npx ci --yes' : 'npx --yes ci'
46
- result = system({ 'NODE_ENV' => 'development' }, cmd)
47
-
47
+ result = system(install_env_args, cmd)
48
48
  # Fallback to `yarn` if `npx` is not available.
49
- system({ 'NODE_ENV' => 'development' }, 'yarn install --frozen-lockfile') if result.nil?
49
+ system(install_env_args, 'yarn install --frozen-lockfile') if result.nil?
50
50
  end
51
51
 
52
52
  desc "Provide information on ViteRuby's environment"
@@ -63,10 +63,12 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
63
63
  Rake::Task["#{ prefix }vite:build_all"].invoke
64
64
  end
65
65
  else
66
+ desc 'Bundle Vite assets'
66
67
  Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build_all'])
67
68
  end
68
69
 
69
70
  unless Rake::Task.task_defined?('assets:clean')
71
+ desc 'Remove old compiled assets'
70
72
  Rake::Task.define_task('assets:clean', [:keep, :age])
71
73
  end
72
74
  Rake::Task['assets:clean'].enhance do |_, args|
@@ -78,6 +80,7 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
78
80
  Rake::Task['vite:clobber'].invoke
79
81
  end
80
82
  else
83
+ desc 'Remove compiled assets'
81
84
  Rake::Task.define_task('assets:clobber' => 'vite:clobber')
82
85
  end
83
86
  end
@@ -51,16 +51,25 @@ class ViteRuby::Manifest
51
51
  if dev_server_running?
52
52
  <<~REACT_REFRESH
53
53
  <script type="module">
54
- import RefreshRuntime from '#{ prefix_asset_with_host('@react-refresh') }'
55
- RefreshRuntime.injectIntoGlobalHook(window)
56
- window.$RefreshReg$ = () => {}
57
- window.$RefreshSig$ = () => (type) => type
58
- window.__vite_plugin_react_preamble_installed__ = true
54
+ #{ react_preamble_code }
59
55
  </script>
60
56
  REACT_REFRESH
61
57
  end
62
58
  end
63
59
 
60
+ # Public: Source script for the React Refresh plugin.
61
+ def react_preamble_code
62
+ if dev_server_running?
63
+ <<~REACT_PREAMBLE_CODE
64
+ import RefreshRuntime from '#{ prefix_asset_with_host('@react-refresh') }'
65
+ RefreshRuntime.injectIntoGlobalHook(window)
66
+ window.$RefreshReg$ = () => {}
67
+ window.$RefreshSig$ = () => (type) => type
68
+ window.__vite_plugin_react_preamble_installed__ = true
69
+ REACT_PREAMBLE_CODE
70
+ end
71
+ end
72
+
64
73
  protected
65
74
 
66
75
  # Internal: Strict version of lookup.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.3.1'
4
+ VERSION = '3.3.3'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
7
  DEFAULT_VITE_VERSION = '^4.3.0'
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.3.1
4
+ version: 3.3.3
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: 2023-04-28 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -208,8 +208,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
208
208
  licenses:
209
209
  - MIT
210
210
  metadata:
211
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.1/vite_ruby
212
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.1/vite_ruby/CHANGELOG.md
211
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.3/vite_ruby
212
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.3/vite_ruby/CHANGELOG.md
213
213
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
214
214
  manually, please run:\n\tbundle exec vite upgrade"
215
215
  rdoc_options: []