vite_ruby 3.1.7 → 3.2.0.beta0

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: f86c32b3157e516c6c3c684ec607655ae3cac76af578376cba83a10cd4894e2c
4
- data.tar.gz: a0cf839776dd9451042a5e1c06780cd380f4e04b7fb69b367a630e617de4ec7c
3
+ metadata.gz: f7911a9ce6fe4bd9652b8b8b95a44b8944bd7edbe30dac6a62779779cc5d8153
4
+ data.tar.gz: 6199eb78cbc2264a6dfa383d42d1b1250f04641cec95b519bcdac59cc1e6b289
5
5
  SHA512:
6
- metadata.gz: a01f1a0cfe320cb64b86e0cb9c7f94d008403f24a0a4c9a8cb7ffd929805dac750cccd4bc6efad5bde406c2bb7284acd35bcdb19b53fdb03fe142db94801cd53
7
- data.tar.gz: 6a25377424956777a1b03d54cf178ae0524a93d804f32896773292e15a47fedf9e4023bca5b34a04d32ddbae0b8ece6db0293da2670392cfc594e343d506679a
6
+ metadata.gz: 82c6447c01c0a5cc80744f8e2aef89909c55a60402ba41c8161bb44e843ee983025c2d7285b4f24c41d357224021e7753310326c68bc16d1e5b0f44c6204b25c
7
+ data.tar.gz: 282131fa6ce58cb844ba04247d1467e9334b3f96891a7f118cf928b8553fb6bcc737ab0d2b3e0c05e6da20fb16c28313c54f88046c673837f010ddfcd65a218d
data/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## [3.1.7](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.1.6...vite_ruby@3.1.7) (2022-07-13)
1
+ # [](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.1.6...vite_ruby@) (2022-07-01)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * npm deprecation warning on assets:precompile ([#226](https://github.com/ElMassimo/vite_ruby/issues/226)) ([e4f4b75](https://github.com/ElMassimo/vite_ruby/commit/e4f4b7540ef34296f1a8a4d8f1d2838549ee8460)), closes [#220](https://github.com/ElMassimo/vite_ruby/issues/220)
6
+ * allow starting an ESM SSR server from a CJS app ([17c8926](https://github.com/ElMassimo/vite_ruby/commit/17c89265f2f5e291ed76784aad647c94e2915d96))
7
7
 
8
8
 
9
9
 
data/lib/tasks/vite.rake CHANGED
@@ -42,7 +42,8 @@ namespace :vite do
42
42
 
43
43
  desc 'Ensure build dependencies like Vite are installed before bundling'
44
44
  task :install_dependencies do
45
- cmd = ViteRuby.commands.legacy_npm_version? ? 'npx ci --yes' : 'npx --yes ci'
45
+ legacy_flag = `npm --version`.to_i < 7 rescue false
46
+ cmd = legacy_flag ? 'npx ci --yes' : 'npx --yes ci'
46
47
  system({ 'NODE_ENV' => 'development' }, cmd)
47
48
  end
48
49
 
@@ -81,10 +82,6 @@ end
81
82
 
82
83
  # Any prerequisite task that installs packages should also install build dependencies.
83
84
  if ARGV.include?('assets:precompile')
84
- if ViteRuby.commands.legacy_npm_version?
85
- ENV['NPM_CONFIG_PRODUCTION'] = 'false'
86
- else
87
- ENV['NPM_CONFIG_INCLUDE'] = 'dev'
88
- end
85
+ ENV['NPM_CONFIG_PRODUCTION'] = 'false'
89
86
  ENV['YARN_PRODUCTION'] = 'false'
90
87
  end
@@ -2,17 +2,27 @@
2
2
 
3
3
  class ViteRuby::CLI::SSR < ViteRuby::CLI::Vite
4
4
  DEFAULT_ENV = CURRENT_ENV || 'production'
5
+ JS_EXTENSIONS = %w[js mjs cjs]
5
6
 
6
7
  desc 'Run the resulting app from building in SSR mode.'
7
8
  executable_options
8
9
 
9
10
  def call(mode:, inspect: false, trace_deprecation: false)
10
11
  ViteRuby.env['VITE_RUBY_MODE'] = mode
12
+
13
+ ssr_entrypoint = JS_EXTENSIONS
14
+ .map { |ext| ViteRuby.config.ssr_output_dir.join("ssr.#{ ext }") }
15
+ .find(&:exist?)
16
+
17
+ unless ssr_entrypoint
18
+ raise ArgumentError, "No ssr entrypoint found `#{ ViteRuby.config.ssr_output_dir.relative_path_from(ViteRuby.config.root) }/ssr.{#{ JS_EXTENSIONS.join(',') }}`. Have you run bin/vite build --ssr?"
19
+ end
20
+
11
21
  cmd = [
12
22
  'node',
13
23
  ('--inspect-brk' if inspect),
14
24
  ('--trace-deprecation' if trace_deprecation),
15
- ViteRuby.config.ssr_output_dir.join('ssr.js'),
25
+ ssr_entrypoint,
16
26
  ]
17
27
  Kernel.exec(*cmd.compact.map(&:to_s))
18
28
  end
@@ -66,11 +66,6 @@ class ViteRuby::Commands
66
66
  `bundle config --delete bin`
67
67
  end
68
68
 
69
- # Internal: Checks if the npm version is 6 or lower.
70
- def legacy_npm_version?
71
- `npm --version`.to_i < 7 rescue false
72
- end
73
-
74
69
  # Internal: Verifies if ViteRuby is properly installed.
75
70
  def verify_install
76
71
  unless File.exist?(config.root.join('bin/vite'))
@@ -7,7 +7,7 @@
7
7
  # lookup_entrypoint('calendar', type: :javascript)
8
8
  # => { "file" => "/vite/assets/calendar-1016838bab065ae1e314.js", "imports" => [] }
9
9
  #
10
- # NOTE: Using `"autoBuild": true` in `config/vite.json` file will trigger a build
10
+ # NOTE: Using "autoBuild": true` in `config/vite.json` file will trigger a build
11
11
  # on demand as needed, before performing any lookup.
12
12
  class ViteRuby::Manifest
13
13
  def initialize(vite_ruby)
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.1.7'
4
+ VERSION = '3.2.0.beta0'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
- DEFAULT_VITE_VERSION = '^2.9.1'
8
- DEFAULT_PLUGIN_VERSION = '^3.0.9'
7
+ DEFAULT_VITE_VERSION = '^3.0.0-beta.5'
8
+ DEFAULT_PLUGIN_VERSION = '^3.1.0-beta.0'
9
9
  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: 3.1.7
4
+ version: 3.2.0.beta0
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: 2022-07-13 00:00:00.000000000 Z
11
+ date: 2022-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -202,8 +202,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
202
202
  licenses:
203
203
  - MIT
204
204
  metadata:
205
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.1.7/vite_ruby
206
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.1.7/vite_ruby/CHANGELOG.md
205
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.2.0.beta0/vite_ruby
206
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.0.beta0/vite_ruby/CHANGELOG.md
207
207
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
208
208
  manually, please run:\n\tbundle exec vite upgrade"
209
209
  rdoc_options: []
@@ -216,9 +216,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
216
216
  version: '2.4'
217
217
  required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  requirements:
219
- - - ">="
219
+ - - ">"
220
220
  - !ruby/object:Gem::Version
221
- version: '0'
221
+ version: 1.3.1
222
222
  requirements: []
223
223
  rubygems_version: 3.3.7
224
224
  signing_key: