sasso-rails 0.1.0 → 0.1.1

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: ec674d60203b29114c080883f7e4cf438fa36dbc8b43daaebb02f7d197ffbf2e
4
- data.tar.gz: cd677fde1997dae468d8ad8acdd4de81a41847931ba6f72a9d7b102cfe523bbe
3
+ metadata.gz: 47fd62745a906cd33915884a073e5388d83256bea9532a27c21a03673834d7b3
4
+ data.tar.gz: f605f87e6c421d01a67c4ee18a336a1b501be756cf74bdac88173e828fe982b5
5
5
  SHA512:
6
- metadata.gz: ca83ee104decbe95b065399c956584959c4f8599658c590c90c371859a920562f611eb7d41171d53e1581a3d66160ccb5bd02fd2545986ad87c9fba975075079
7
- data.tar.gz: 9df668f046ac42666b9ab9e65aba3b0b29fe3dfb0d018ccf8f7afc821f8f4378e76afbf0b5ca151ac6efc9b987a52160f0279fdcfeaa55215e3bb3738c39347c
6
+ metadata.gz: 85f6248e5b1bec53c62170a86d94b9e7ebad12777447057b117d9410f63d5887918188f0d031e79a477aae9509d901cdeb54c9b1eac07a36531678744efb79d9
7
+ data.tar.gz: 6a616ebbe2dbdda75c06f717d4fa7c71a0815aa2fcba243b6ea6ccf8db0cfb36696b1869fb346de3396709c6baa956dc172ce5deb7a8da616fbd3f5cf9129062
data/CHANGELOG.md CHANGED
@@ -8,6 +8,19 @@ the engine-gem version range it requires.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.1.1] - 2026-06-13
12
+
13
+ Makes `bin/rails generate sasso:install` drop-in on a fresh Rails 8 app.
14
+
15
+ ### Fixed
16
+
17
+ - The installer now removes the default `app/assets/stylesheets/application.css`,
18
+ which otherwise collides with the compiled `app/assets/builds/application.css`
19
+ on the asset load path (both resolve to the logical path `application.css`).
20
+ - The installer repoints the Rails 8 default layout's `stylesheet_link_tag :app`
21
+ to `stylesheet_link_tag "application"` so the compiled CSS is actually linked
22
+ (no-op if the layout already links `"application"` or was customized).
23
+
11
24
  ## [0.1.0] - 2026-06-13
12
25
 
13
26
  Initial release. Requires the `sasso` gem **>= 0.1.1, < 1**.
data/README.md CHANGED
@@ -30,15 +30,18 @@ bin/rails generate sasso:install
30
30
  ```
31
31
 
32
32
  The installer scaffolds `app/assets/stylesheets/application.scss`, creates
33
- `app/assets/builds/` (with a `.keep`), links the builds directory in a Sprockets
34
- manifest if one exists, and adds a watch process to `Procfile.dev`.
35
-
36
- Reference the compiled CSS in your layout:
33
+ `app/assets/builds/` (with a `.keep`), removes the default
34
+ `app/assets/stylesheets/application.css` (it would collide with the compiled
35
+ output), links the builds directory in a Sprockets manifest if one exists, adds
36
+ a watch process to `Procfile.dev`, and points your layout at the compiled CSS:
37
37
 
38
38
  ```erb
39
39
  <%= stylesheet_link_tag "application" %>
40
40
  ```
41
41
 
42
+ (On Rails 8 the default layout links `:app`; the installer repoints it to
43
+ `"application"`. If you wire the link yourself, use `"application"`.)
44
+
42
45
  ## Usage
43
46
 
44
47
  ```sh
@@ -9,10 +9,33 @@ module Sasso
9
9
  class InstallGenerator < ::Rails::Generators::Base
10
10
  source_root File.expand_path("templates", __dir__)
11
11
 
12
+ # A fresh Propshaft/Sprockets app ships app/assets/stylesheets/application.css.
13
+ # Our compiled output is app/assets/builds/application.css — both resolve to
14
+ # the logical path "application.css" on the asset load path, which collides.
15
+ # The build dir owns the compiled CSS now (the cssbundling convention), so
16
+ # drop the default stub.
17
+ def remove_default_application_css
18
+ default = "app/assets/stylesheets/application.css"
19
+ remove_file default if File.exist?(File.join(destination_root, default))
20
+ end
21
+
12
22
  def create_stylesheet
13
23
  template "application.scss", "app/assets/stylesheets/application.scss"
14
24
  end
15
25
 
26
+ # Rails 8 layouts default to `stylesheet_link_tag :app`, which looks for
27
+ # "app.css" and won't pick up our compiled "application.css". Point it at
28
+ # the entrypoint we build. No-op if the layout is missing or already links
29
+ # "application" (so a customized layout is left alone).
30
+ def link_stylesheet_in_layout
31
+ layout = "app/views/layouts/application.html.erb"
32
+ full = File.join(destination_root, layout)
33
+ return unless File.exist?(full)
34
+ return if File.read(full).include?('stylesheet_link_tag "application"')
35
+
36
+ gsub_file layout, /stylesheet_link_tag\s+:app\b/, 'stylesheet_link_tag "application"'
37
+ end
38
+
16
39
  def ensure_builds_directory
17
40
  create_file "app/assets/builds/.keep" unless File.exist?(builds_keep_path)
18
41
 
@@ -5,6 +5,6 @@ module Sasso
5
5
  # Versioned INDEPENDENTLY of both the `sasso` gem and the `sasso` crate.
6
6
  # The gemspec pins the engine gem with a range (sasso >= 0.1.1, < 1), so a
7
7
  # compiler bump does not force a lockstep release of this integration gem.
8
- VERSION = "0.1.0"
8
+ VERSION = "0.1.1"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sasso-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - momiji-rs