opal-vite-rails 0.3.14 → 0.3.16

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: 5ef10da23927e3793b0aa7d4730e9007800bf70ab430b05ee9ddc550a81af197
4
- data.tar.gz: d06c1b304ebf7e7985b74d89f352fa0ec6f08edba9a0726ed1a407733329bd02
3
+ metadata.gz: 4324653e587faaeb544294659054bd01b0815ac4056950d8ee8de78c62fd8778
4
+ data.tar.gz: 00333bbe532cced98a84165a037bbd7df9247ed4cf06c568b0dce4e98cc79b5c
5
5
  SHA512:
6
- metadata.gz: d8a1992423ad276695e0dfcb021e4b2d6f0109ebc6688b27f13251359eae7d7ccdebd36c832c73e41d3825f30a0bff791a66999d718127558562a52fbaae8223
7
- data.tar.gz: d2e47d18cebb49f142b840985e7ff1361b3740c41bdc5002669450d66143f3d587f73fa022aae250127a85f9964ae9a693200a2b0f1f17a25e875eefbd2d5fd6
6
+ metadata.gz: 0a7a1739693c6aa93583d2bb0dc48c6dacf18ba215bd0b371d69ee9df396a5774838d9b234918b719d0b07b561c531f925cfe61079a93b9735bc2d4e4f38332e
7
+ data.tar.gz: 6d36e9693f19c772a3f91609a63104bbcbc6cab6bf267b3f542fc3142e218b21836d29200278bfeaac250f1bfe3d8f31fbf86e9b73b68f5ad5567a3a56599466
data/README.md CHANGED
@@ -197,9 +197,9 @@ Compile Opal assets:
197
197
  rake opal_vite:compile
198
198
  ```
199
199
 
200
- This runs Vite build and creates optimized bundles in `public/vite/`.
200
+ This runs the Vite build (through vite_ruby, like `rake vite:build`) and creates optimized bundles in `public/vite/`.
201
201
 
202
- The compile task is automatically added to `rake assets:precompile`, so it runs during deployment on platforms like Heroku.
202
+ You usually don't need to run it yourself: vite_rails already runs the Vite build, which compiles the Opal sources, as part of `rake assets:precompile`, so deployment on platforms like Heroku works without an extra step.
203
203
 
204
204
  ## Rake Tasks
205
205
 
@@ -326,6 +326,7 @@ The npm plugin runs the gem's Ruby code, so keep the two in step:
326
326
 
327
327
  | vite-plugin-opal (npm) | opal-vite (gem) | opal-vite-rails (gem) | Notes |
328
328
  |------------------------|-----------------|-----------------------|-------|
329
+ | >= 0.3.19 | >= 0.3.18 | >= 0.3.14 | `loadPaths` / `arityCheck` / `freezing` are applied when compiling |
329
330
  | >= 0.3.16 | >= 0.3.15 | >= 0.3.14 | Shared runtime: corelib is loaded once |
330
331
  | >= 0.3.16 | 0.3.12 – 0.3.14 | — | Works; each `.rb` bundle carries its own corelib (warning at startup) |
331
332
  | >= 0.3.16 | < 0.3.12 | — | Works without the `stubs` option (using it fails with a clear error) |
@@ -49,9 +49,8 @@ module Opal
49
49
  end
50
50
  end
51
51
 
52
- rake_tasks do
53
- load "tasks/opal_vite.rake"
54
- end
52
+ # lib/tasks/*.rake is loaded by Rails::Engine automatically; loading it
53
+ # again here would define every task action twice.
55
54
 
56
55
  generators do
57
56
  require_relative "generators/install_generator"
@@ -1,7 +1,7 @@
1
1
  module Opal
2
2
  module Vite
3
3
  module Rails
4
- VERSION = "0.3.14"
4
+ VERSION = "0.3.16"
5
5
  end
6
6
  end
7
7
  end
@@ -1,27 +1,19 @@
1
1
  namespace :opal_vite do
2
- desc "Compile Opal assets for production"
2
+ # Opal sources are compiled by the Vite build (vite-plugin-opal), so this
3
+ # delegates to vite_ruby, the same build `rake vite:build` runs. vite_rails
4
+ # already hooks that build into `assets:precompile`, so nothing is added
5
+ # there.
6
+ desc "Compile Opal assets for production (runs the Vite build)"
3
7
  task compile: :environment do
4
- require "opal/vite/rails"
5
-
6
8
  puts "Compiling Opal assets..."
7
9
 
8
- # Ensure Vite is installed
9
- unless system("which vite > /dev/null 2>&1")
10
- puts "Error: Vite is not installed. Run 'npm install' first."
11
- exit 1
12
- end
13
-
14
- # Run Vite build
15
- puts "Running Vite build..."
16
- system("npm run build") || system("npx vite build")
10
+ abort "❌ Vite build failed" unless ViteRuby.commands.build
17
11
 
18
12
  puts "✅ Opal assets compiled successfully!"
19
13
  end
20
14
 
21
15
  desc "Clean compiled Opal assets"
22
16
  task clean: :environment do
23
- require "opal/vite/rails"
24
-
25
17
  puts "Cleaning Opal assets..."
26
18
 
27
19
  vite_dir = Rails.public_path.join("vite")
@@ -35,8 +27,6 @@ namespace :opal_vite do
35
27
 
36
28
  desc "Show Opal-Vite configuration"
37
29
  task info: :environment do
38
- require "opal/vite/rails"
39
-
40
30
  puts "\n" + "="*60
41
31
  puts "Opal-Vite Rails Configuration"
42
32
  puts "="*60
@@ -56,10 +46,3 @@ namespace :opal_vite do
56
46
  puts "\n" + "="*60
57
47
  end
58
48
  end
59
-
60
- # Add compile task to assets:precompile
61
- if Rake::Task.task_defined?("assets:precompile")
62
- Rake::Task["assets:precompile"].enhance do
63
- Rake::Task["opal_vite:compile"].invoke
64
- end
65
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-vite-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - stofu1234