sasso 0.2.7-aarch64-linux → 0.14.1-aarch64-linux

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: afa936103e7f520de2b2f78e3d709a18b263ccd5e41c23ea50c1a6d66c11af4d
4
- data.tar.gz: 13aa8cc441c37bb9a22bd1175e842775bb7beb3192d3f00408826512bd105f7f
3
+ metadata.gz: d8f79fdce5fe7f72e878093bbed2cd3b5a9ec2338e80b6a374370e91134d96b3
4
+ data.tar.gz: 3c158adde39064736b2adbbbefd7b0a1ecfc2d3536a8c44acde36832164a3575
5
5
  SHA512:
6
- metadata.gz: aad4c08cec3c4555d36e7f7ce492e6ad1f9d767b5ed436464a75048a8b6db4be71198d93d4df9a607a88404178dd2130d49313ec3a2c338f85005b878b50dcaf
7
- data.tar.gz: a4bd4255dd68ac2948de8ba26d5c68e0a5b0805d7ad2ac0d5aa5d51cdc928d380cee11933426360d07750177a5dcd2cff4b73ecf1a8f20695b990704a3894688
6
+ metadata.gz: 95703ed946f6637ada5524ae2818b2590afd682912f037ac62cb4ff00ba0e5c122c1855545046744009c21ac60a2250aeeea11e5397a8d331fdd9572cc64b7fc
7
+ data.tar.gz: 81b69e236a99466ef22197792ee5a2a31f9a5729760bed0b2614fb494bc3dd4089d33f38328c6145478e7c2c5ba74f55266ae6b25e9ee51cec248081a429fefc
data/CHANGELOG.md CHANGED
@@ -3,11 +3,131 @@
3
3
  All notable changes to the **sasso** Ruby gem are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
- The gem version floats independently of the `sasso` compiler crate; each release
7
- notes the exact core crate version it pins.
6
+ Since 0.14.0 the gem version tracks the `sasso` compiler crate it bundles; each
7
+ release notes the exact core crate version it pins. Releases up to 0.2.7 versioned
8
+ the gem independently of the crate.
8
9
 
9
10
  ## [Unreleased]
10
11
 
12
+ ## [0.14.1] - 2026-10-30
13
+
14
+ _A gem-only patch. The bundled core compiler is still `sasso` 0.14.0, so
15
+ `Sasso::CORE_VERSION` reports 0.14.0 and the CSS output is unchanged._
16
+
17
+ ### Added
18
+
19
+ - **Ruby 4.0 support.** The precompiled platform gems now carry a Ruby 4.0
20
+ binary, and CI tests against 4.0. Previously 4.0 fell back to the source gem,
21
+ which did not compile.
22
+
23
+ ### Fixed
24
+
25
+ - **The source gem compiles on Ruby 4.0.** The extension now builds against
26
+ magnus 0.8 instead of 0.7, whose bindings do not match the Ruby 4.0 headers.
27
+
28
+ ## [0.14.0] - 2026-09-17
29
+
30
+ _The gem version now tracks the core compiler's. It jumps 0.2.7 → 0.14.0 to meet
31
+ `sasso` 0.14.0, adopting seven core releases at once (0.7.0 through 0.14.0)._
32
+
33
+ _**Why align.** The gem version floated independently, so "sasso 0.2.7" said
34
+ nothing about which compiler it carried: the three framework gems each had to
35
+ document the mapping, and a bug report needed both numbers to be actionable.
36
+ From here, a gem release adopting core X.Y.Z **is** gem X.Y.Z. A gem-only fix
37
+ takes the next patch, so the gem may sit ahead of the crate within a minor —
38
+ the new `Sasso::CORE_VERSION` always reports what is actually linked._
39
+
40
+ _The Ruby API is backward compatible; the CSS the compiler emits is not, in the
41
+ ways listed below._
42
+
43
+ ### Removed
44
+
45
+ - **Ruby 3.1 support** (`required_ruby_version` is now `>= 3.2.0`). It left
46
+ security maintenance in March 2025, and is off the precompiled-gem matrix.
47
+
48
+ ### Changed (output — dart-sass 1.101.4 → 1.104.1 alignment)
49
+
50
+ The gem's Ruby API is unchanged, but the CSS it emits moved with the core. If
51
+ you byte-compare output — snapshot tests, asset digests, build caches — expect
52
+ diffs. Every change below is **serialization only** — the CSS still means what
53
+ it meant — with **one exception, the first**: `whiteness()` / `blackness()` stop
54
+ being evaluated, which makes the declaration around them invalid, so a browser
55
+ drops it. That one is worth grepping for; the rest are safe to re-baseline.
56
+
57
+ - **Global `whiteness()` / `blackness()` are no longer built-ins** (core 0.9.0):
58
+ they are `sass:color`-only, so the bare call is now an unknown function and
59
+ passes through as plain CSS instead of being evaluated. `whiteness(#f00)` goes
60
+ from `0%` to `whiteness(#f00)`, and `1 + whiteness(#f00)` to `1whiteness(#f00)`
61
+ — both byte-identical to dart-sass 1.104.1, and both **silent**: no error, no
62
+ warning. This is the change in this release to grep your stylesheets for. Use
63
+ `color.whiteness()` / `color.blackness()` via `@use "sass:color"`.
64
+ - A legacy color with any fractional channel writes its rgb triple as
65
+ **percentages**: `rgb(127.5, 0, 127.5)` becomes `rgb(50%, 0%, 50%)` (0.9.0).
66
+ - **Compressed hsl/hwb route through rgb** like every other legacy space, so
67
+ `darken(#336699, 10%)` compresses to `rgb(15%,30%,45%)` rather than
68
+ `hsl(210,50%,30%)` (0.9.0).
69
+ - **A negative zero keeps its sign**: `0 * -1`, `-0` and `math.div(0, -1)`
70
+ serialize as `-0`. The sign is the IEEE sign bit, so `0 - 0` stays `0` (0.10.0).
71
+ - **Colors convert their degenerate channels**: a `NaN` channel becomes `0`, and
72
+ a polar hue converts every non-finite value (0.10.0).
73
+ - **`rec2020` uses the pure 2.4 gamma transfer function**, replacing the BT.2020
74
+ piecewise curve (0.9.0).
75
+ - **Plain-CSS `if()` emits in CSS serialization format**, not `meta.inspect`
76
+ format: lists lose their parens, `null` serializes to nothing (0.9.0).
77
+ - **A comment before `@use` is emitted exactly once**; a repeat edge into an
78
+ already-loaded module no longer re-emits it (0.10.0).
79
+ - Extensive **`@extend`, module-system and selector line-break fidelity** fixes
80
+ (0.7.0, 0.8.0) — the work that took all 20 projects in the core's real-world
81
+ corpus to byte-identical with dart-sass.
82
+
83
+ ### Changed (source maps)
84
+
85
+ - **A declaration whose value is a bare `$name` maps back to the variable's
86
+ definition**, transitively through `$b: $a` chains, module members and
87
+ mixin/function parameters (0.9.0). The segment used to be omitted, which also
88
+ renumbered every following delta-encoded segment — so a recorded `mappings`
89
+ string changes.
90
+
91
+ ### Changed (diagnostics)
92
+
93
+ - **Function arity errors follow dart's wording**: only positional arguments
94
+ count, and the word "positional" appears once any named argument is in play
95
+ (0.10.0).
96
+ - **An error inside a loaded file is attributed to that file**, with one stack
97
+ frame per loader, for `@use`, `@forward` and `@import` chains alike (0.7.0).
98
+
99
+ ### Added
100
+
101
+ - **`charset:`** (dart-sass `charset`) — `false` omits the `@charset "UTF-8";`
102
+ prefix, or the U+FEFF BOM when compressed, that non-ASCII output carries.
103
+ - **`quiet:`** — print no `@warn`/`@debug`/deprecation diagnostics. They have
104
+ always gone to `$stderr`; there was previously no way off.
105
+ - **`quiet_deps:`** (dart-sass `quietDeps`) — drop deprecation warnings raised
106
+ inside dependencies (files resolved through a load path), while the entry
107
+ stylesheet's own still print. `@warn` is untouched either way.
108
+ - **`on_warn:`** — a callable receiving each diagnostic as a Hash of the new
109
+ `Sasso::WARNING_KEYS`, which replaces the stderr printing rather than
110
+ duplicating it. `:formatted` carries the full dart-style block, so the
111
+ compiler's own rendering can go straight into an application logger.
112
+ Mutually exclusive with `quiet:`. A compile that warns and then fails delivers
113
+ its warnings before raising `Sasso::CompileError`, the way dart-sass hands them
114
+ to its logger before throwing.
115
+ - **`Sasso::CORE_VERSION`** — the bundled compiler crate's version, read from
116
+ the linked binary so it cannot drift from what is loaded.
117
+
118
+ ### Documentation
119
+
120
+ - The README documents **`source_map:` and `CompileResult` for the first time**;
121
+ they shipped in gem 0.2.0 and never reached it. `sig/sasso.rbs` gains them too,
122
+ alongside the new options.
123
+ - The **Performance table is remeasured**: this working tree (core 0.14.0)
124
+ against `sass-embedded` 1.104.1 and `sassc` 2.4.0. The ~180-rule case is ~10%
125
+ faster. The cold-start row is **corrected upward**, from a claimed 1.1 ms to a
126
+ measured 3.2 ms — that figure reproduced on neither the old gem nor the new, so
127
+ it predates this release; the margin over `sass-embedded` is 12.7×, not 35×.
128
+ - `benchmark/Gemfile` takes **`SASSO_PATH`** to benchmark a working tree instead
129
+ of the published gem, which is what the README's table now reports.
130
+
11
131
  ## [0.2.7] - 2026-06-25
12
132
 
13
133
  ### Changed
data/README.md CHANGED
@@ -6,7 +6,7 @@ In-process **SCSS / Sass → CSS** compilation for Ruby, backed by [**sasso**](h
6
6
 
7
7
  > This gem is the Ruby binding. The compiler core lives in the separate
8
8
  > [`momiji-rs/sasso`](https://github.com/momiji-rs/sasso) repo (crate on
9
- > crates.io); this gem pins it exactly and releases on its own cadence.
9
+ > crates.io); this gem pins it exactly and carries its version number.
10
10
 
11
11
  ## Install
12
12
 
@@ -19,9 +19,21 @@ gem "sasso"
19
19
  $ bundle install
20
20
  ```
21
21
 
22
- Precompiled native gems ship for common platforms (Linux gnu/musl, macOS, and
23
- Windows on x86_64/arm64), so no Rust toolchain is needed. On other platforms the
24
- gem compiles from source via `cargo` (needs a Rust toolchain).
22
+ **Ruby 3.2, 3.3, 3.4 and 4.0** are supported, and CI tests each of them on
23
+ Linux and macOS. Ruby 4.0 needs sasso 0.14.1 or later.
24
+
25
+ Precompiled native gems for all four Ruby versions ship for these platforms, so
26
+ they need no Rust toolchain:
27
+
28
+ | OS | platforms |
29
+ |---|---|
30
+ | Linux (glibc) | `x86_64-linux`, `aarch64-linux` |
31
+ | Linux (musl) | `x86_64-linux-musl`, `aarch64-linux-musl` |
32
+ | macOS | `x86_64-darwin`, `arm64-darwin` |
33
+ | Windows | `x64-mingw-ucrt` |
34
+
35
+ On any other platform the gem compiles from source with `cargo`, which needs a
36
+ Rust toolchain.
25
37
 
26
38
  ## Usage
27
39
 
@@ -52,6 +64,78 @@ Sasso.compile("app/assets/stylesheets/application.scss",
52
64
  | `load_paths:` | `[]` | directories searched for `@use`/`@forward`/`@import` |
53
65
  | `url:` | `nil` | filename shown in diagnostics (enables the rich dart-style error block) |
54
66
  | `alert_ascii:` | `false` | ASCII-only diagnostics |
67
+ | `charset:` | `true` | prefix non-ASCII output with `@charset "UTF-8";` (a BOM when compressed) |
68
+ | `source_map:` | `false` | return a `Sasso::CompileResult` instead of a String |
69
+ | `source_map_include_sources:` | `false` | embed each source's text in the map's `sourcesContent` |
70
+ | `quiet:` | `false` | print no `@warn`/`@debug`/deprecation diagnostics |
71
+ | `quiet_deps:` | `false` | drop deprecation warnings raised inside dependencies |
72
+ | `on_warn:` | `nil` | a callable receiving each diagnostic; replaces the stderr printing |
73
+
74
+ ### Source maps
75
+
76
+ With `source_map: true` the return value is a `Sasso::CompileResult` — `#css` is
77
+ the same String you would get otherwise, and `#source_map` is a parsed Source Map
78
+ v3 Hash. Pass `url:` so the map can name the entry stylesheet.
79
+
80
+ ```ruby
81
+ r = Sasso.compile_string(scss, source_map: true, url: "application.scss")
82
+ r.css # => "a {\n color: red;\n}"
83
+ r.source_map["version"] # => 3
84
+ r.source_map["sources"] # => ["application.scss"]
85
+ ```
86
+
87
+ ### Diagnostics
88
+
89
+ `@warn`, `@debug` and deprecation warnings print to `$stderr` by default, the
90
+ same dart-style block the `sasso` CLI and dart-sass print. Two ways to change
91
+ that:
92
+
93
+ ```ruby
94
+ # Silence them entirely:
95
+ Sasso.compile_string(scss, quiet: true)
96
+
97
+ # Silence only what dependencies deprecate (dart-sass `quietDeps`) — files
98
+ # resolved through a load path. The entry stylesheet's own still print.
99
+ Sasso.compile_string(scss, load_paths: ["vendor/stylesheets"], quiet_deps: true)
100
+
101
+ # Or take delivery yourself, which suppresses the printing:
102
+ Sasso.compile_string(scss, url: "in.scss", on_warn: ->(d) {
103
+ next if d[:deprecation_id] == "color-functions"
104
+
105
+ Rails.logger.warn(d[:formatted]) # the block the compiler would have printed
106
+ })
107
+ ```
108
+
109
+ Each diagnostic is a Hash of `Sasso::WARNING_KEYS`: `:kind` (`:warn`/`:debug`),
110
+ `:deprecation`, `:deprecation_id`, `:message`, `:formatted`, `:url`, `:line` and
111
+ `:path`. `:url` is dart's display form of the file; `:path` identifies it (the
112
+ importer's canonical path), which is what distinguishes a dependency from the
113
+ entry stylesheet. `quiet:` and `on_warn:` are mutually exclusive.
114
+
115
+ Two things to know about what `on_warn:` receives:
116
+
117
+ - A compile that warns and then **fails** delivers its warnings first and raises
118
+ `Sasso::CompileError` after, so a diagnostic is never lost to the error — the
119
+ callable is the only thing reporting them once it has taken over. If the
120
+ callable itself raises, the `CompileError` still wins and carries that
121
+ exception as its `#cause`.
122
+ - Like dart-sass, the compiler **caps a repeated deprecation at five per id** and
123
+ then emits one summary diagnostic — `"N repetitive deprecation warnings
124
+ omitted."` — with no `:deprecation_id`, no `:url` and `:line` of `0`. Code that
125
+ keys on the id or formats `"#{d[:url]}:#{d[:line]}"` should expect it. There is
126
+ no verbose mode that lifts the cap; the compiler core does not offer one.
127
+
128
+ ### Versions
129
+
130
+ Since 0.14.0 the gem version tracks the core compiler crate it bundles: gem
131
+ 0.14.0 pins crate 0.14.0. A gem-only fix takes the next patch, so `Sasso::VERSION`
132
+ may sit ahead of the crate within a minor — `Sasso::CORE_VERSION` reads the
133
+ version out of the linked binary and is the authority on what is loaded.
134
+
135
+ ```ruby
136
+ Sasso::VERSION # => "0.14.0" the gem
137
+ Sasso::CORE_VERSION # => "0.14.0" the compiler actually linked in
138
+ ```
55
139
 
56
140
  ### Errors
57
141
 
@@ -92,20 +176,20 @@ IPC, no Dart VM), it avoids the per-call protocol roundtrip of `sass-embedded`
92
176
  and the process-spawn cost paid by any out-of-process compiler.
93
177
 
94
178
  Compiling the same SCSS (variables, nesting, `@for`, math) on an Apple M2 Max,
95
- Ruby 3.4.1:
179
+ Ruby 3.4.1, against `sass-embedded` 1.104.1 and `sassc` 2.4.0:
96
180
 
97
181
  | | `sasso` (this gem) | `sass-embedded` (dart-sass) | `sassc` (libsass) |
98
182
  | --- | --: | --: | --: |
99
- | Warm — small component (256 B) | **13.5 µs** | 129 µs (**9.5×**) | 1151 µs (85×) |
100
- | Warm — ~180 rules (5.5 KB) | **237 µs** | 915 µs (**3.8×**) | 10178 µs (43×) |
101
- | Cold start (`require` + first compile) | **1.1 ms** | 38.5 ms (**35×**) | 35.6 ms (32×) |
183
+ | Warm — small component (256 B) | **13.3 µs** | 125 µs (**9.4×**) | 1148 µs (87×) |
184
+ | Warm — ~180 rules (5.5 KB) | **215 µs** | 906 µs (**4.2×**) | 10234 µs (48×) |
185
+ | Cold start (`require` + first compile) | **3.2 ms** | 40.6 ms (**12.7×**) | 37.0 ms (12×) |
102
186
 
103
187
  Parenthesised values are how much slower the other gem is than `sasso`.
104
188
 
105
189
  - **Per-request compiling** (e.g. a Sinatra route): in-process latency is ~13 µs
106
- vs ~129 µs for `sass-embedded`'s pipe roundtrip to its Dart subprocess.
190
+ vs ~125 µs for `sass-embedded`'s pipe roundtrip to its Dart subprocess.
107
191
  - **One-shot builds** (e.g. `rails assets:precompile`): the dominant cost is the
108
- ~38 ms Dart subprocess spawn, which `sasso` does not pay (~1 ms cold).
192
+ ~41 ms Dart subprocess spawn, which `sasso` does not pay (~3 ms cold).
109
193
 
110
194
  The engine is also heavily perf-tuned (a scoped bump arena, reference-counted
111
195
  values). Numbers are representative of one machine; run your own with your
Binary file
Binary file
Binary file
Binary file
data/lib/sasso/version.rb CHANGED
@@ -1,7 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sasso
4
- # The gem version floats INDEPENDENTLY of the core `sasso` crate version; the
5
- # native extension pins the crate exactly (ext/sasso/Cargo.toml: sasso = "=…").
6
- VERSION = "0.2.7"
4
+ # Tracks the core `sasso` crate this gem bundles: a release adopting core
5
+ # X.Y.Z is gem X.Y.Z, and the native extension pins that crate exactly
6
+ # (ext/sasso/Cargo.toml). A gem-only fix takes the next patch, so the gem may
7
+ # sit ahead of the crate within a minor — `Sasso::CORE_VERSION` reads the
8
+ # version out of the linked binary and is the authority on what is loaded.
9
+ VERSION = "0.14.1"
7
10
  end
data/lib/sasso.rb CHANGED
@@ -31,9 +31,21 @@ rescue LoadError
31
31
  end
32
32
 
33
33
  module Sasso
34
+ # The bundled compiler crate's version, read from the linked binary rather
35
+ # than written down here, so it cannot drift from what is actually loaded.
36
+ # VERSION tracks it as of 0.14.0, but a gem-only patch moves ahead of it.
37
+ CORE_VERSION = Sasso::Native._core_version.freeze
38
+
34
39
  STYLES = %i[expanded compressed].freeze
35
40
  SYNTAXES = %i[scss sass css].freeze
36
41
 
42
+ # The keys of a diagnostic Hash handed to `on_warn:`. `:kind` is :warn or
43
+ # :debug; `:formatted` is the full dart-style block (header, snippet, stack
44
+ # trace) the compiler would otherwise have printed to stderr; `:url` is dart's
45
+ # display form of the source file and `:path` identifies it (the importer's
46
+ # canonical path), which is what tells a dependency from the entry stylesheet.
47
+ WARNING_KEYS = %i[kind deprecation deprecation_id message formatted url line path].freeze
48
+
37
49
  module_function
38
50
 
39
51
  # Compile a SCSS/Sass source String to a CSS String.
@@ -44,20 +56,50 @@ module Sasso
44
56
  # load_paths: dirs searched for @use/@forward/@import (built-in importer)
45
57
  # url: filename shown in diagnostics; ENABLES the dart-exact error block
46
58
  # alert_ascii: true => ASCII-only diagnostics (maps to the compiler's no-unicode)
59
+ # charset: false => omit the @charset/BOM prefix on non-ASCII output
60
+ # quiet: true => print no @warn/@debug/deprecation diagnostics at all
61
+ # quiet_deps: true => drop deprecation warnings raised inside dependencies
62
+ # on_warn: a callable receiving each diagnostic as a Hash (see WARNING_KEYS);
63
+ # taking delivery this way replaces the default stderr printing
47
64
  #
65
+ # Diagnostics go to $stderr by default, as the `sasso` CLI and dart-sass do.
48
66
  # Raises Sasso::CompileError on a compile failure; ArgumentError on bad options.
49
67
  def compile_string(source, style: :expanded, syntax: :scss, indented: false,
50
68
  load_paths: [], url: nil, alert_ascii: false,
51
- source_map: false, source_map_include_sources: false)
69
+ source_map: false, source_map_include_sources: false,
70
+ charset: true, quiet: false, quiet_deps: false, on_warn: nil)
52
71
  syntax = :sass if indented
53
72
  validate!(style, STYLES, :style)
54
73
  validate!(syntax, SYNTAXES, :syntax)
55
- paths = Array(load_paths).map(&:to_s)
56
- src = String(source)
57
- return Sasso::Native._compile(src, style.to_s, syntax.to_s, paths, url && url.to_s, !alert_ascii) unless source_map
74
+ # A positional Hash, not keyword arguments: `_compile` is a C function and
75
+ # has no keyword parameters, so the braces say what actually crosses the ABI.
76
+ css, map_json, diagnostics, error = Sasso::Native._compile(String(source), {
77
+ style: style.to_s,
78
+ syntax: syntax.to_s,
79
+ load_paths: Array(load_paths).map(&:to_s),
80
+ url: url && url.to_s,
81
+ unicode: !alert_ascii,
82
+ source_map: source_map,
83
+ source_map_include_sources: source_map_include_sources,
84
+ charset: charset,
85
+ quiet_deps: quiet_deps,
86
+ warnings: warnings_mode(quiet, on_warn),
87
+ })
88
+ # Deliver first, raise second: a compile can warn and then fail, and those
89
+ # warnings are the caller's only copy once `on_warn:` has taken over from
90
+ # the compiler's own printing. The native side hands the failure back as a
91
+ # String for exactly this reason.
92
+ # The `ensure` is what makes the compile failure win when the callable
93
+ # itself raises: a logger that is down should not mask the Sass error, which
94
+ # is the actual news. Ruby records the callable's exception as the
95
+ # CompileError's #cause, so neither is lost.
96
+ begin
97
+ diagnostics.each { |d| on_warn.call(d) } if on_warn
98
+ ensure
99
+ raise CompileError, error if error
100
+ end
101
+ return css unless source_map
58
102
 
59
- css, map_json = Sasso::Native._compile_with_map(src, style.to_s, syntax.to_s, paths,
60
- url && url.to_s, !alert_ascii, source_map_include_sources)
61
103
  CompileResult.new(css, JSON.parse(map_json))
62
104
  end
63
105
 
@@ -87,4 +129,22 @@ module Sasso
87
129
  "invalid #{name}: #{value.inspect} (expected one of #{allowed.inspect})"
88
130
  end
89
131
  private_class_method :validate!
132
+
133
+ # Which diagnostic mode the native side installs. "stderr" leaves the
134
+ # compiler's own handler in place — the default costs nothing, and the block
135
+ # prints as it is raised rather than after the compile. The other two modes
136
+ # install a handler, which is what suppresses that printing.
137
+ def warnings_mode(quiet, on_warn)
138
+ if on_warn
139
+ raise ArgumentError, "quiet: and on_warn: are mutually exclusive" if quiet
140
+ raise ArgumentError, "on_warn: must respond to #call" unless on_warn.respond_to?(:call)
141
+
142
+ "capture"
143
+ elsif quiet
144
+ "silence"
145
+ else
146
+ "stderr"
147
+ end
148
+ end
149
+ private_class_method :warnings_mode
90
150
  end
data/sig/sasso.rbs CHANGED
@@ -1,15 +1,42 @@
1
1
  module Sasso
2
2
  VERSION: String
3
+ CORE_VERSION: String
3
4
  STYLES: Array[Symbol]
4
5
  SYNTAXES: Array[Symbol]
6
+ WARNING_KEYS: Array[Symbol]
7
+
8
+ # One @warn / @debug / deprecation diagnostic, as handed to `on_warn:`.
9
+ type warning = {
10
+ kind: Symbol,
11
+ deprecation: bool,
12
+ deprecation_id: String,
13
+ message: String,
14
+ formatted: String,
15
+ url: String,
16
+ line: Integer,
17
+ path: String,
18
+ }
5
19
 
6
20
  class Error < StandardError
7
21
  end
8
22
  class CompileError < Error
9
23
  end
10
24
 
25
+ # `Struct.new(:css, :source_map)`. The constructor is spelled out because an
26
+ # RBS class without one inherits `Object`'s zero-argument `new`, which would
27
+ # reject the two-argument call the implementation makes.
28
+ class CompileResult < Struct[untyped]
29
+ attr_reader css: String
30
+ attr_reader source_map: Hash[String, untyped]
31
+
32
+ def initialize: (String css, Hash[String, untyped] source_map) -> void
33
+ end
34
+
11
35
  def self.compile_string: (String source, ?style: Symbol, ?syntax: Symbol,
12
36
  ?indented: bool, ?load_paths: Array[untyped],
13
- ?url: String?, ?alert_ascii: bool) -> String
14
- def self.compile: (untyped path, **untyped opts) -> String
37
+ ?url: String?, ?alert_ascii: bool,
38
+ ?source_map: bool, ?source_map_include_sources: bool,
39
+ ?charset: bool, ?quiet: bool, ?quiet_deps: bool,
40
+ ?on_warn: (^(warning) -> void)?) -> (String | CompileResult)
41
+ def self.compile: (untyped path, **untyped opts) -> (String | CompileResult)
15
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sasso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.14.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - momiji-rs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-25 00:00:00.000000000 Z
11
+ date: 2026-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -63,10 +63,10 @@ files:
63
63
  - LICENSE-MIT
64
64
  - README.md
65
65
  - lib/sasso.rb
66
- - lib/sasso/3.1/sasso.so
67
66
  - lib/sasso/3.2/sasso.so
68
67
  - lib/sasso/3.3/sasso.so
69
68
  - lib/sasso/3.4/sasso.so
69
+ - lib/sasso/4.0/sasso.so
70
70
  - lib/sasso/version.rb
71
71
  - sig/sasso.rbs
72
72
  homepage: https://github.com/momiji-rs/sasso-ruby
@@ -85,10 +85,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '3.1'
88
+ version: '3.2'
89
89
  - - "<"
90
90
  - !ruby/object:Gem::Version
91
- version: 3.5.dev
91
+ version: 4.1.dev
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
Binary file