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 +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +7 -4
- data/lib/generators/sasso/install/install_generator.rb +23 -0
- data/lib/sasso/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47fd62745a906cd33915884a073e5388d83256bea9532a27c21a03673834d7b3
|
|
4
|
+
data.tar.gz: f605f87e6c421d01a67c4ee18a336a1b501be756cf74bdac88173e828fe982b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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`),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
data/lib/sasso/rails/version.rb
CHANGED
|
@@ -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.
|
|
8
|
+
VERSION = "0.1.1"
|
|
9
9
|
end
|
|
10
10
|
end
|