rails_vite 0.3.0.rc1 → 0.3.0

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: 8e7210773488e0deadb365f2fb2ab6782d1b347d77ca2f63007eada5cbe6c59f
4
- data.tar.gz: 687c142b64c7eb24431696f56c105be88b06c68686689d40005f773f8d70aebf
3
+ metadata.gz: 29fa5e627ce8cb0a69adedff8837ad1eb8c849a2080e7977719f46f2a6e79217
4
+ data.tar.gz: 9d67574b9cc609ca924bfd17bc5b44a93e83958e157a1b1d323831e7375f84fd
5
5
  SHA512:
6
- metadata.gz: d4a84d843acb2feb2c9f80d26386b5071ca8c4a8093332d8e71880cddbbf608351709f30fb7cef147b25f7114818eb2b09b8d35ea0808affdf19b67594574446
7
- data.tar.gz: e483f34f03fed33786db337c84b5cb290e7ce2ad65e3c73b7294f5e75b77aabffe934dac00b2cb55d79517b65181b699b43f7c4ef9feedadf2ea1190ec1781a6
6
+ metadata.gz: 53746498cef9a7d767ee14e0b8c5fe846ddcc3b7243083b5c5c22e943762db477864737b40595b2d88fe4001d50c05972c6252e28044567fcb8d9dc257ea0525
7
+ data.tar.gz: 11ed614a5ed73d43f00520ebbc4d14467b29d1f9dea092f655656b5bf67a2a04758261bdac5c07a80f894de0a5469455fe7bad0efcd937b520efd3f0508a1fa9
data/CHANGELOG.md CHANGED
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog],
6
6
  and this project adheres to [Semantic Versioning].
7
7
 
8
- ## rails_vite@0.3.0.rc1 / rails-vite-plugin@0.3.0-rc.1 - 2026-10-11
8
+ ## rails_vite@0.3.0 / rails-vite-plugin@0.3.0 - 2026-10-11
9
9
 
10
10
  ### Added
11
11
 
@@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning].
23
23
  - Vite asset URLs are built with Rails' `path_to_asset`, so `asset_host` works as it does for other Rails assets: procs that take the request, `%d` hosts and per-controller hosts. Mailers now use `config.action_mailer.asset_host` (or `config.asset_host`) instead of the controller's. With `relative_url_root`, tags now include the prefix; set Vite's `base` to match (#36) ([@skryukov])
24
24
  - `rake vite:build` loads the Rails environment first, so `config.rails_vite` settings from initializers (such as `vite_executable`) also apply to it and to `bin/rails test` (#42) ([@cole-robertson])
25
25
  - The install generator writes `vite dev` instead of `vite` to `Procfile.dev` (#42) ([@cole-robertson])
26
- - **Breaking:** `vite:build` (and therefore `assets:precompile`) runs the package.json `build` script when one exists, so `"build": "vite build && vite build --ssr"` produces both client and SSR bundles on deploy. Apps without a `build` script keep the bare `vite build`. If package.json already has a `build` script (e.g. one left over from jsbundling-rails), make sure it builds with Vite before upgrading. Test builds and auto-builds always use the bare command, since their extra flags (`--mode test`, `--logLevel warn`) would only reach the last command of a compound script (#38) ([@skryukov])
26
+ - **Breaking:** `vite:build` (and therefore `assets:precompile`) runs the package.json `build` script when one exists, so `"build": "vite build && vite build --ssr"` produces both client and SSR bundles on deploy. Apps without a `build` script keep the bare `vite build`. If package.json already has a `build` script (e.g. one left over from jsbundling-rails), change it to `"build": "vite build"` or remove it before upgrading; otherwise precompile succeeds without Vite assets and production raises `RailsVite::MissingManifestError`. The install generator warns about such a script. Test builds and auto-builds always use the bare command, since their extra flags (`--mode test`, `--logLevel warn`) would only reach the last command of a compound script (#38) ([@skryukov])
27
27
 
28
28
  ### Fixed
29
29
 
data/README.md CHANGED
@@ -48,7 +48,7 @@ bundle install
48
48
  bin/rails generate rails_vite:install
49
49
  ```
50
50
 
51
- This creates `vite.config.ts`, installs dependencies, and updates your layout.
51
+ This creates `vite.config.ts`, installs dependencies, and replaces `javascript_include_tag "application"` and `stylesheet_link_tag "application"` in your layout with `vite_tags`. Other layouts, such as the Rails 8 default, need it by hand: replace `javascript_importmap_tags` with `<%= vite_tags "application" %>`.
52
52
 
53
53
  Start development:
54
54
 
@@ -533,7 +533,7 @@ In development, jsbundling mode writes `tmp/rails-vite.json` — the same file t
533
533
  ```json
534
534
  // package.json — replace vite-plugin-ruby with rails-vite-plugin
535
535
  - "vite-plugin-ruby": "^5.1.1"
536
- + "rails-vite-plugin": "^0.2.0"
536
+ + "rails-vite-plugin": "^0.3.0"
537
537
  ```
538
538
 
539
539
  ### 2. Replace `vite.config.ts`
@@ -28,6 +28,15 @@ module RailsVite
28
28
  end
29
29
  end
30
30
 
31
+ def warn_about_build_script
32
+ return unless File.exist?("package.json")
33
+
34
+ script = JSON.parse(File.read("package.json")).dig("scripts", "build")
35
+ return if script.blank? || script.match?(/\b(vite|vp)\b/)
36
+
37
+ say %(package.json has a "build" script that assets:precompile will run instead of `vite build`: #{script}. Change it to "vite build" or remove it.), :yellow
38
+ end
39
+
31
40
  def create_vite_config
32
41
  template "vite.config.ts.tt", @esm_package ? "vite.config.ts" : "vite.config.mts"
33
42
  end
@@ -1,3 +1,3 @@
1
1
  module RailsVite
2
- VERSION = "0.3.0.rc1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_vite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.rc1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov