sasso 0.1.2-x86_64-linux → 0.2.1-x86_64-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: 4a231781057faac6edb0cd6ad6c52e4340b395748c577b592b6a81a3f901bb3a
4
- data.tar.gz: 91b0e8283d7fdb8017b3c8d47b6357044eb153be8ee5e9a0b6cc6283c849eba0
3
+ metadata.gz: 514131478fbbbd039b08685fa65fbacfa0dbcb97361c806c6a61e5c6b5f2e5bb
4
+ data.tar.gz: 1397e2983ab94e35e5e91a5d7db491e8d007739c541bfb3bb824a2bdebfd2b23
5
5
  SHA512:
6
- metadata.gz: af418067b66e543aba3424d8c3a4e799cea85e2128cae0877a11b3d0d8b4f3ff742611c463d05d5ec2a63aefe3a3a0f5d9b9bcef51bfc4e946c000559ad0a950
7
- data.tar.gz: 33fffa39f064652b3cedeccf72546b4f2fa9e0311fe6a0b4ec961a050d72b1e7af3adc28f354d4f47df02a76ec2ab16ec7803328a6dfcb3fcef3e8c0faf40569
6
+ metadata.gz: beca9b66515a53633cb09d324f793f72ea33b37cf8e52ed049cbea81172c5ef48c58d21eb6aaf86ccfaaee7c02efdee296959cb46eefbbfe4fc823895b98f675
7
+ data.tar.gz: 85816df9580c52d423f52f9dd08648adf7be7b67da7625da7980f00c331a59140ab8dd7d24aae7f02d039099fc658e1d74def73dc02fc71fbc0e36ea60a52a5f
data/CHANGELOG.md CHANGED
@@ -8,6 +8,32 @@ notes the exact core crate version it pins.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.2.1] - 2026-06-14
12
+
13
+ Adopts core crate **v0.5.1**.
14
+
15
+ ### Fixed
16
+
17
+ - Via core v0.5.1: source maps now map the `@media`/`@at-root`/`@supports`
18
+ bubbled parent selector and the `@supports` header, byte-exact to dart-sass —
19
+ fixing a 0.5.0 (= gem 0.2.0 pinned 0.4.0) compressed-map gap for `@media`/
20
+ `@at-root`-bubbled rules. Compressed output also gains dart-faithful whitespace
21
+ for `@media`/`@supports` preludes (`@media(min-width: 1px)`, `(a)and (b)`).
22
+
23
+ ## [0.2.0] - 2026-06-14
24
+
25
+ Adopts core crate **v0.4.0**.
26
+
27
+ ### Added
28
+
29
+ - **Source map support.** `Sasso.compile_string(source, source_map: true)` (and
30
+ `Sasso.compile(path, source_map: true)`) returns a `Sasso::CompileResult` with
31
+ `#css` (the CSS String) and `#source_map` (the Source Map v3 as a parsed Hash:
32
+ `"version" => 3`, `"mappings"`, `"sources"`, …). Pass
33
+ `source_map_include_sources: true` to embed the full source text in the map's
34
+ `sourcesContent`. Without `source_map:` the methods still return a plain CSS
35
+ String (backwards compatible). The mappings are byte-identical to dart-sass.
36
+
11
37
  ## [0.1.2] - 2026-06-13
12
38
 
13
39
  Adopts core crate **v0.3.1**.
Binary file
Binary file
Binary file
Binary file
data/lib/sasso/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module Sasso
4
4
  # The gem version floats INDEPENDENTLY of the core `sasso` crate version; the
5
5
  # native extension pins the crate exactly (ext/sasso/Cargo.toml: sasso = "=…").
6
- VERSION = "0.1.2"
6
+ VERSION = "0.2.1"
7
7
  end
data/lib/sasso.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "json"
3
4
  require_relative "sasso/version"
4
5
 
5
6
  module Sasso
@@ -10,6 +11,11 @@ module Sasso
10
11
  # diagnostic (the same text the `sasso` CLI prints) when a `url:` is given,
11
12
  # otherwise the legacy `Error: <msg> (line:col)` one-liner.
12
13
  class CompileError < Error; end
14
+
15
+ # Returned by `compile_string`/`compile` when `source_map: true`. `#css` is the
16
+ # CSS String (identical to the plain-String return); `#source_map` is the
17
+ # Source Map v3 as a parsed Hash (`"version" => 3`, `"mappings"`, `"sources"`, …).
18
+ CompileResult = Struct.new(:css, :source_map)
13
19
  end
14
20
 
15
21
  # Load the compiled native extension. Precompiled ("fat") gems place a copy per
@@ -41,13 +47,18 @@ module Sasso
41
47
  #
42
48
  # Raises Sasso::CompileError on a compile failure; ArgumentError on bad options.
43
49
  def compile_string(source, style: :expanded, syntax: :scss, indented: false,
44
- load_paths: [], url: nil, alert_ascii: false)
50
+ load_paths: [], url: nil, alert_ascii: false,
51
+ source_map: false, source_map_include_sources: false)
45
52
  syntax = :sass if indented
46
53
  validate!(style, STYLES, :style)
47
54
  validate!(syntax, SYNTAXES, :syntax)
48
55
  paths = Array(load_paths).map(&:to_s)
49
- Sasso::Native._compile(String(source), style.to_s, syntax.to_s,
50
- paths, url && url.to_s, !alert_ascii)
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
58
+
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
+ CompileResult.new(css, JSON.parse(map_json))
51
62
  end
52
63
 
53
64
  # Compile the file at `path`. Syntax is inferred from the extension unless
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.1.2
4
+ version: 0.2.1
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - momiji-rs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-13 00:00:00.000000000 Z
11
+ date: 2026-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake