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 +4 -4
- data/CHANGELOG.md +3 -3
- data/lib/tasks/vite.rake +3 -6
- data/lib/vite_ruby/cli/ssr.rb +11 -1
- data/lib/vite_ruby/commands.rb +0 -5
- data/lib/vite_ruby/manifest.rb +1 -1
- data/lib/vite_ruby/version.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7911a9ce6fe4bd9652b8b8b95a44b8944bd7edbe30dac6a62779779cc5d8153
|
4
|
+
data.tar.gz: 6199eb78cbc2264a6dfa383d42d1b1250f04641cec95b519bcdac59cc1e6b289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c6447c01c0a5cc80744f8e2aef89909c55a60402ba41c8161bb44e843ee983025c2d7285b4f24c41d357224021e7753310326c68bc16d1e5b0f44c6204b25c
|
7
|
+
data.tar.gz: 282131fa6ce58cb844ba04247d1467e9334b3f96891a7f118cf928b8553fb6bcc737ab0d2b3e0c05e6da20fb16c28313c54f88046c673837f010ddfcd65a218d
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
# [](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.1.6...vite_ruby@) (2022-07-01)
|
2
2
|
|
3
3
|
|
4
|
-
###
|
4
|
+
### Features
|
5
5
|
|
6
|
-
*
|
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
|
-
|
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
|
-
|
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
|
data/lib/vite_ruby/cli/ssr.rb
CHANGED
@@ -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
|
-
|
25
|
+
ssr_entrypoint,
|
16
26
|
]
|
17
27
|
Kernel.exec(*cmd.compact.map(&:to_s))
|
18
28
|
end
|
data/lib/vite_ruby/commands.rb
CHANGED
@@ -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'))
|
data/lib/vite_ruby/manifest.rb
CHANGED
@@ -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
|
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)
|
data/lib/vite_ruby/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class ViteRuby
|
4
|
-
VERSION = '3.
|
4
|
+
VERSION = '3.2.0.beta0'
|
5
5
|
|
6
6
|
# Internal: Versions used by default when running `vite install`.
|
7
|
-
DEFAULT_VITE_VERSION = '^
|
8
|
-
DEFAULT_PLUGIN_VERSION = '^3.0.
|
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.
|
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-
|
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.
|
206
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.
|
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:
|
221
|
+
version: 1.3.1
|
222
222
|
requirements: []
|
223
223
|
rubygems_version: 3.3.7
|
224
224
|
signing_key:
|