sass-embedded 1.69.7 → 1.71.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: 5ddf58c29aaacc85fb79d2f70cccf60ef11566a7dd961ce4d1b6753580e63be7
4
- data.tar.gz: 3f94c4fc1435af31542aba4af84997a0e3628372ead2fe0e61a5eafd35270d76
3
+ metadata.gz: f3466041c73d4f5e8747b2657b29e0483187a6c8d17099b31d0c2bfb6c9ca008
4
+ data.tar.gz: b0c79984d3e2915ffd3c1d8c46a5d71177fa1ea0993d6002daba2dfeb19f9b2d
5
5
  SHA512:
6
- metadata.gz: 91a8794f30f711b9e5f3c23e93aeff8e2849c194f1774a3125c69d06f71b5e0a195a8b8114701ee27089b7bd5b6ecd922aaaabcc3886577aab0e0c2668c2ddac
7
- data.tar.gz: b51d8a8acd12db57a88293a9f8a4b6c0efebc8591e167ae7e3ce56dbf776d1cc0d2e64c980ceb78802356659afc142a9f6128e11e1e3264340074d0aef664acc
6
+ metadata.gz: 01250032610c87ac6c5f580ab9dc39059d73eb72a2cd8ae1e2dbae3023b422f8ba7fed33271677848a5d16b954c6e0b716dcf6ff968a0ec8d68ee8ff72a065e8
7
+ data.tar.gz: 46bad4b3f39d1662945ee4b7afa27eb78fa879a1c0ef1afb436408f605ee517304420cfcbc73274e2348e54503aefd3925c09873fa3f9489c15a07aaf7661f9f
data/ext/sass/Rakefile CHANGED
@@ -21,7 +21,7 @@ file 'dart-sass' do |t|
21
21
  raise if ENV.key?('DART_SASS')
22
22
 
23
23
  gem_install 'sass-embedded', SassConfig.gem_version, SassConfig.gem_platform do |dir|
24
- cp_r File.absolute_path("ext/sass/#{t.name}", dir), t.name
24
+ mv File.absolute_path("ext/sass/#{t.name}", dir), t.name
25
25
  end
26
26
  rescue StandardError
27
27
  archive = fetch(ENV.fetch('DART_SASS') { SassConfig.default_dart_sass })
@@ -138,16 +138,22 @@ module FileUtils
138
138
  def fetch(source_uri, dest_path = nil)
139
139
  require 'rubygems/remote_fetcher'
140
140
 
141
- unless source_uri.is_a?(URI::Generic)
141
+ source_uri = begin
142
+ Gem::Uri.parse!(source_uri)
143
+ rescue NoMethodError
142
144
  begin
143
- source_uri = URI.parse(source_uri)
145
+ URI.parse(source_uri)
144
146
  rescue StandardError
145
- source_uri = URI.parse(URI::DEFAULT_PARSER.escape(source_uri.to_s))
147
+ URI.parse(URI::DEFAULT_PARSER.escape(source_uri.to_s))
146
148
  end
147
149
  end
148
150
 
149
151
  scheme = source_uri.scheme
150
- source_path = URI::DEFAULT_PARSER.unescape(source_uri.path || source_uri.opaque)
152
+ source_path = begin
153
+ Gem::URI::DEFAULT_PARSER
154
+ rescue NameError
155
+ URI::DEFAULT_PARSER
156
+ end.unescape(source_uri.path || source_uri.opaque)
151
157
 
152
158
  if Gem.win_platform? && scheme =~ /^[a-z]$/i && !source_path.include?(':')
153
159
  source_path = "#{scheme}:#{source_path}"
@@ -167,10 +173,7 @@ module FileUtils
167
173
  symbol = :"fetch_#{scheme}"
168
174
  raise ArgumentError, "Unsupported URI scheme #{scheme}" unless fetcher.respond_to?(symbol)
169
175
 
170
- if Rake::FileUtilsExt.verbose_flag
171
- redacted_uri = Gem::RemoteFetcher::FetchError.new('', source_uri).uri
172
- Rake.rake_output_message "fetch #{redacted_uri}"
173
- end
176
+ Rake.rake_output_message "fetch #{Gem::Uri.new(source_uri).redacted}" if Rake::FileUtilsExt.verbose_flag
174
177
 
175
178
  unless Rake::FileUtilsExt.nowrite_flag
176
179
  data = fetcher.public_send(symbol, source_uri)
@@ -182,7 +185,7 @@ module FileUtils
182
185
  end
183
186
 
184
187
  def gem_install(name, version, platform)
185
- install_dir = File.absolute_path('ruby', __dir__)
188
+ install_dir = File.absolute_path('ruby')
186
189
 
187
190
  if Rake::FileUtilsExt.verbose_flag
188
191
  Rake.rake_output_message [
@@ -279,6 +282,8 @@ module SassConfig
279
282
 
280
283
  message = "dart-sass for #{Platform::ARCH} not available at #{repo}/releases/tag/#{tag_name}"
281
284
 
285
+ env = ''
286
+
282
287
  os = case Platform::OS
283
288
  when 'darwin'
284
289
  'macos'
@@ -287,7 +292,9 @@ module SassConfig
287
292
  when 'linux-android'
288
293
  'android'
289
294
  when 'linux-musl'
290
- 'linux-musl'
295
+ repo = 'https://github.com/sass-contrib/dart-sass-musl'
296
+ env = '-musl'
297
+ 'linux'
291
298
  when 'windows'
292
299
  'windows'
293
300
  else
@@ -309,7 +316,7 @@ module SassConfig
309
316
 
310
317
  ext = Platform::OS == 'windows' ? 'zip' : 'tar.gz'
311
318
 
312
- "#{repo}/releases/download/#{tag_name}/dart-sass-#{tag_name}-#{os}-#{cpu}.#{ext}"
319
+ "#{repo}/releases/download/#{tag_name}/dart-sass-#{tag_name}-#{os}-#{cpu}#{env}.#{ext}"
313
320
  end
314
321
 
315
322
  def default_protoc
@@ -351,7 +358,7 @@ module SassConfig
351
358
 
352
359
  uri = "#{repo}/#{version}/protoc-#{version}-#{os}-#{cpu}.exe"
353
360
 
354
- Gem::RemoteFetcher.fetcher.fetch_https(URI.parse("#{uri}.sha1"))
361
+ Gem::RemoteFetcher.fetcher.fetch_https(Gem::Uri.new("#{uri}.sha1"))
355
362
 
356
363
  uri
357
364
  rescue Gem::RemoteFetcher::FetchError
@@ -362,7 +369,7 @@ module SassConfig
362
369
  tuples.sort.reverse_each do |name_tuple, _source|
363
370
  uri = "#{repo}/#{name_tuple.version}/protoc-#{name_tuple.version}-#{os}-#{cpu}.exe"
364
371
 
365
- Gem::RemoteFetcher.fetcher.fetch_https(URI.parse("#{uri}.sha1"))
372
+ Gem::RemoteFetcher.fetcher.fetch_https(Gem::Uri.new("#{uri}.sha1"))
366
373
 
367
374
  return uri
368
375
  rescue Gem::RemoteFetcher::FetchError
@@ -5,7 +5,7 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
 
8
- descriptor_data = "\n\x13\x65mbedded_sass.proto\x12\x16sass.embedded_protocol\"\xf7\x0e\n\x0eInboundMessage\x12P\n\x0f\x63ompile_request\x18\x02 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.CompileRequestH\x00\x12\\\n\x15\x63\x61nonicalize_response\x18\x03 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.CanonicalizeResponseH\x00\x12P\n\x0fimport_response\x18\x04 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.ImportResponseH\x00\x12Y\n\x14\x66ile_import_response\x18\x05 \x01(\x0b\x32\x39.sass.embedded_protocol.InboundMessage.FileImportResponseH\x00\x12]\n\x16\x66unction_call_response\x18\x06 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.FunctionCallResponseH\x00\x12P\n\x0fversion_request\x18\x07 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.VersionRequestH\x00\x1a\x1c\n\x0eVersionRequest\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xe5\x05\n\x0e\x43ompileRequest\x12S\n\x06string\x18\x02 \x01(\x0b\x32\x41.sass.embedded_protocol.InboundMessage.CompileRequest.StringInputH\x00\x12\x0e\n\x04path\x18\x03 \x01(\tH\x00\x12\x32\n\x05style\x18\x04 \x01(\x0e\x32#.sass.embedded_protocol.OutputStyle\x12\x12\n\nsource_map\x18\x05 \x01(\x08\x12Q\n\timporters\x18\x06 \x03(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x12\x18\n\x10global_functions\x18\x07 \x03(\t\x12\x13\n\x0b\x61lert_color\x18\x08 \x01(\x08\x12\x13\n\x0b\x61lert_ascii\x18\t \x01(\x08\x12\x0f\n\x07verbose\x18\n \x01(\x08\x12\x12\n\nquiet_deps\x18\x0b \x01(\x08\x12\"\n\x1asource_map_include_sources\x18\x0c \x01(\x08\x12\x0f\n\x07\x63harset\x18\r \x01(\x08\x1a\xac\x01\n\x0bStringInput\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12.\n\x06syntax\x18\x03 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12P\n\x08importer\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x1aw\n\x08Importer\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x15\n\x0bimporter_id\x18\x02 \x01(\rH\x00\x12\x1a\n\x10\x66ile_importer_id\x18\x03 \x01(\rH\x00\x12\x1c\n\x14non_canonical_scheme\x18\x04 \x03(\tB\n\n\x08importerB\x07\n\x05inputJ\x04\x08\x01\x10\x02\x1aL\n\x14\x43\x61nonicalizeResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x93\x02\n\x0eImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12V\n\x07success\x18\x02 \x01(\x0b\x32\x43.sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccessH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x1a\x81\x01\n\rImportSuccess\x12\x10\n\x08\x63ontents\x18\x01 \x01(\t\x12.\n\x06syntax\x18\x02 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12\x1b\n\x0esource_map_url\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_source_map_urlB\x08\n\x06result\x1aO\n\x12\x46ileImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x12\n\x08\x66ile_url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x90\x01\n\x14\x46unctionCallResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x30\n\x07success\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.ValueH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x12\x1f\n\x17\x61\x63\x63\x65ssed_argument_lists\x18\x04 \x03(\rB\x08\n\x06resultB\t\n\x07message\"\x97\x0f\n\x0fOutboundMessage\x12\x36\n\x05\x65rror\x18\x01 \x01(\x0b\x32%.sass.embedded_protocol.ProtocolErrorH\x00\x12S\n\x10\x63ompile_response\x18\x02 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.CompileResponseH\x00\x12\x45\n\tlog_event\x18\x03 \x01(\x0b\x32\x30.sass.embedded_protocol.OutboundMessage.LogEventH\x00\x12[\n\x14\x63\x61nonicalize_request\x18\x04 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.CanonicalizeRequestH\x00\x12O\n\x0eimport_request\x18\x05 \x01(\x0b\x32\x35.sass.embedded_protocol.OutboundMessage.ImportRequestH\x00\x12X\n\x13\x66ile_import_request\x18\x06 \x01(\x0b\x32\x39.sass.embedded_protocol.OutboundMessage.FileImportRequestH\x00\x12\\\n\x15\x66unction_call_request\x18\x07 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.FunctionCallRequestH\x00\x12S\n\x10version_response\x18\x08 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.VersionResponseH\x00\x1a\x8e\x01\n\x0fVersionResponse\x12\n\n\x02id\x18\x05 \x01(\r\x12\x18\n\x10protocol_version\x18\x01 \x01(\t\x12\x18\n\x10\x63ompiler_version\x18\x02 \x01(\t\x12\x1e\n\x16implementation_version\x18\x03 \x01(\t\x12\x1b\n\x13implementation_name\x18\x04 \x01(\t\x1a\xa2\x03\n\x0f\x43ompileResponse\x12Y\n\x07success\x18\x02 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccessH\x00\x12Y\n\x07\x66\x61ilure\x18\x03 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailureH\x00\x12\x13\n\x0bloaded_urls\x18\x04 \x03(\t\x1a\x37\n\x0e\x43ompileSuccess\x12\x0b\n\x03\x63ss\x18\x01 \x01(\t\x12\x12\n\nsource_map\x18\x02 \x01(\tJ\x04\x08\x03\x10\x04\x1a{\n\x0e\x43ompileFailure\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x30\n\x04span\x18\x02 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpan\x12\x13\n\x0bstack_trace\x18\x03 \x01(\t\x12\x11\n\tformatted\x18\x04 \x01(\tB\x08\n\x06resultJ\x04\x08\x01\x10\x02\x1a\xbd\x01\n\x08LogEvent\x12\x32\n\x04type\x18\x02 \x01(\x0e\x32$.sass.embedded_protocol.LogEventType\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x35\n\x04span\x18\x04 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpanH\x00\x88\x01\x01\x12\x13\n\x0bstack_trace\x18\x05 \x01(\t\x12\x11\n\tformatted\x18\x06 \x01(\tB\x07\n\x05_spanJ\x04\x08\x01\x10\x02\x1a\x8e\x01\n\x13\x43\x61nonicalizeRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x43\n\rImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\tJ\x04\x08\x02\x10\x03\x1a\x8c\x01\n\x11\x46ileImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x8e\x01\n\x13\x46unctionCallRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x66unction_id\x18\x04 \x01(\rH\x00\x12\x30\n\targuments\x18\x05 \x03(\x0b\x32\x1d.sass.embedded_protocol.ValueB\x0c\n\nidentifierJ\x04\x08\x02\x10\x03\x42\t\n\x07message\"e\n\rProtocolError\x12\x37\n\x04type\x18\x01 \x01(\x0e\x32).sass.embedded_protocol.ProtocolErrorType\x12\n\n\x02id\x18\x02 \x01(\r\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x87\x02\n\nSourceSpan\x12\x0c\n\x04text\x18\x01 \x01(\t\x12@\n\x05start\x18\x02 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocation\x12\x43\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocationH\x00\x88\x01\x01\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x05 \x01(\t\x1a>\n\x0eSourceLocation\x12\x0e\n\x06offset\x18\x01 \x01(\r\x12\x0c\n\x04line\x18\x02 \x01(\r\x12\x0e\n\x06\x63olumn\x18\x03 \x01(\rB\x06\n\x04_end\"\xb8\x13\n\x05Value\x12\x36\n\x06string\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.StringH\x00\x12\x36\n\x06number\x18\x02 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12;\n\trgb_color\x18\x03 \x01(\x0b\x32&.sass.embedded_protocol.Value.RgbColorH\x00\x12;\n\thsl_color\x18\x04 \x01(\x0b\x32&.sass.embedded_protocol.Value.HslColorH\x00\x12\x32\n\x04list\x18\x05 \x01(\x0b\x32\".sass.embedded_protocol.Value.ListH\x00\x12\x30\n\x03map\x18\x06 \x01(\x0b\x32!.sass.embedded_protocol.Value.MapH\x00\x12;\n\tsingleton\x18\x07 \x01(\x0e\x32&.sass.embedded_protocol.SingletonValueH\x00\x12K\n\x11\x63ompiler_function\x18\x08 \x01(\x0b\x32..sass.embedded_protocol.Value.CompilerFunctionH\x00\x12\x43\n\rhost_function\x18\t \x01(\x0b\x32*.sass.embedded_protocol.Value.HostFunctionH\x00\x12\x43\n\rargument_list\x18\n \x01(\x0b\x32*.sass.embedded_protocol.Value.ArgumentListH\x00\x12;\n\thwb_color\x18\x0b \x01(\x0b\x32&.sass.embedded_protocol.Value.HwbColorH\x00\x12@\n\x0b\x63\x61lculation\x18\x0c \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x12\x45\n\x0e\x63ompiler_mixin\x18\r \x01(\x0b\x32+.sass.embedded_protocol.Value.CompilerMixinH\x00\x1a&\n\x06String\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0e\n\x06quoted\x18\x02 \x01(\x08\x1a\x41\n\x06Number\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x12\n\nnumerators\x18\x02 \x03(\t\x12\x14\n\x0c\x64\x65nominators\x18\x03 \x03(\t\x1a\x43\n\x08RgbColor\x12\x0b\n\x03red\x18\x01 \x01(\r\x12\r\n\x05green\x18\x02 \x01(\r\x12\x0c\n\x04\x62lue\x18\x03 \x01(\r\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aM\n\x08HslColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x12\n\nsaturation\x18\x02 \x01(\x01\x12\x11\n\tlightness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aL\n\x08HwbColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x11\n\twhiteness\x18\x02 \x01(\x01\x12\x11\n\tblackness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1a\x87\x01\n\x04List\x12\x38\n\tseparator\x18\x01 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12\x14\n\x0chas_brackets\x18\x02 \x01(\x08\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\xa2\x01\n\x03Map\x12\x38\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\'.sass.embedded_protocol.Value.Map.Entry\x1a\x61\n\x05\x45ntry\x12*\n\x03key\x18\x01 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\x1e\n\x10\x43ompilerFunction\x12\n\n\x02id\x18\x01 \x01(\r\x1a-\n\x0cHostFunction\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\t\x1a\x1b\n\rCompilerMixin\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xa1\x02\n\x0c\x41rgumentList\x12\n\n\x02id\x18\x01 \x01(\r\x12\x38\n\tseparator\x18\x02 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x12J\n\x08keywords\x18\x04 \x03(\x0b\x32\x38.sass.embedded_protocol.Value.ArgumentList.KeywordsEntry\x1aN\n\rKeywordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value:\x02\x38\x01\x1a\xef\x04\n\x0b\x43\x61lculation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\targuments\x18\x02 \x03(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x1a\x95\x02\n\x10\x43\x61lculationValue\x12\x36\n\x06number\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12\x10\n\x06string\x18\x02 \x01(\tH\x00\x12\x17\n\rinterpolation\x18\x03 \x01(\tH\x00\x12S\n\toperation\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.Value.Calculation.CalculationOperationH\x00\x12@\n\x0b\x63\x61lculation\x18\x05 \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x42\x07\n\x05value\x1a\xea\x01\n\x14\x43\x61lculationOperation\x12=\n\x08operator\x18\x01 \x01(\x0e\x32+.sass.embedded_protocol.CalculationOperator\x12H\n\x04left\x18\x02 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x12I\n\x05right\x18\x03 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValueB\x07\n\x05value*+\n\x0bOutputStyle\x12\x0c\n\x08\x45XPANDED\x10\x00\x12\x0e\n\nCOMPRESSED\x10\x01*)\n\x06Syntax\x12\x08\n\x04SCSS\x10\x00\x12\x0c\n\x08INDENTED\x10\x01\x12\x07\n\x03\x43SS\x10\x02*?\n\x0cLogEventType\x12\x0b\n\x07WARNING\x10\x00\x12\x17\n\x13\x44\x45PRECATION_WARNING\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x02*8\n\x11ProtocolErrorType\x12\t\n\x05PARSE\x10\x00\x12\n\n\x06PARAMS\x10\x01\x12\x0c\n\x08INTERNAL\x10\x02*?\n\rListSeparator\x12\t\n\x05\x43OMMA\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\t\n\x05SLASH\x10\x02\x12\r\n\tUNDECIDED\x10\x03*/\n\x0eSingletonValue\x12\x08\n\x04TRUE\x10\x00\x12\t\n\x05\x46\x41LSE\x10\x01\x12\x08\n\x04NULL\x10\x02*A\n\x13\x43\x61lculationOperator\x12\x08\n\x04PLUS\x10\x00\x12\t\n\x05MINUS\x10\x01\x12\t\n\x05TIMES\x10\x02\x12\n\n\x06\x44IVIDE\x10\x03\x42#\n\x1f\x63om.sass_lang.embedded_protocolP\x01\x62\x06proto3"
8
+ descriptor_data = "\n\x13\x65mbedded_sass.proto\x12\x16sass.embedded_protocol\"\xd6\x0f\n\x0eInboundMessage\x12P\n\x0f\x63ompile_request\x18\x02 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.CompileRequestH\x00\x12\\\n\x15\x63\x61nonicalize_response\x18\x03 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.CanonicalizeResponseH\x00\x12P\n\x0fimport_response\x18\x04 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.ImportResponseH\x00\x12Y\n\x14\x66ile_import_response\x18\x05 \x01(\x0b\x32\x39.sass.embedded_protocol.InboundMessage.FileImportResponseH\x00\x12]\n\x16\x66unction_call_response\x18\x06 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.FunctionCallResponseH\x00\x12P\n\x0fversion_request\x18\x07 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.VersionRequestH\x00\x1a\x1c\n\x0eVersionRequest\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xc4\x06\n\x0e\x43ompileRequest\x12S\n\x06string\x18\x02 \x01(\x0b\x32\x41.sass.embedded_protocol.InboundMessage.CompileRequest.StringInputH\x00\x12\x0e\n\x04path\x18\x03 \x01(\tH\x00\x12\x32\n\x05style\x18\x04 \x01(\x0e\x32#.sass.embedded_protocol.OutputStyle\x12\x12\n\nsource_map\x18\x05 \x01(\x08\x12Q\n\timporters\x18\x06 \x03(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x12\x18\n\x10global_functions\x18\x07 \x03(\t\x12\x13\n\x0b\x61lert_color\x18\x08 \x01(\x08\x12\x13\n\x0b\x61lert_ascii\x18\t \x01(\x08\x12\x0f\n\x07verbose\x18\n \x01(\x08\x12\x12\n\nquiet_deps\x18\x0b \x01(\x08\x12\"\n\x1asource_map_include_sources\x18\x0c \x01(\x08\x12\x0f\n\x07\x63harset\x18\r \x01(\x08\x12\x0e\n\x06silent\x18\x0e \x01(\x08\x1a\xac\x01\n\x0bStringInput\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12.\n\x06syntax\x18\x03 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12P\n\x08importer\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x1a\xc5\x01\n\x08Importer\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x15\n\x0bimporter_id\x18\x02 \x01(\rH\x00\x12\x1a\n\x10\x66ile_importer_id\x18\x03 \x01(\rH\x00\x12L\n\x15node_package_importer\x18\x05 \x01(\x0b\x32+.sass.embedded_protocol.NodePackageImporterH\x00\x12\x1c\n\x14non_canonical_scheme\x18\x04 \x03(\tB\n\n\x08importerB\x07\n\x05inputJ\x04\x08\x01\x10\x02\x1aL\n\x14\x43\x61nonicalizeResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x93\x02\n\x0eImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12V\n\x07success\x18\x02 \x01(\x0b\x32\x43.sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccessH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x1a\x81\x01\n\rImportSuccess\x12\x10\n\x08\x63ontents\x18\x01 \x01(\t\x12.\n\x06syntax\x18\x02 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12\x1b\n\x0esource_map_url\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_source_map_urlB\x08\n\x06result\x1aO\n\x12\x46ileImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x12\n\x08\x66ile_url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x90\x01\n\x14\x46unctionCallResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x30\n\x07success\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.ValueH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x12\x1f\n\x17\x61\x63\x63\x65ssed_argument_lists\x18\x04 \x03(\rB\x08\n\x06resultB\t\n\x07message\"\x97\x0f\n\x0fOutboundMessage\x12\x36\n\x05\x65rror\x18\x01 \x01(\x0b\x32%.sass.embedded_protocol.ProtocolErrorH\x00\x12S\n\x10\x63ompile_response\x18\x02 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.CompileResponseH\x00\x12\x45\n\tlog_event\x18\x03 \x01(\x0b\x32\x30.sass.embedded_protocol.OutboundMessage.LogEventH\x00\x12[\n\x14\x63\x61nonicalize_request\x18\x04 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.CanonicalizeRequestH\x00\x12O\n\x0eimport_request\x18\x05 \x01(\x0b\x32\x35.sass.embedded_protocol.OutboundMessage.ImportRequestH\x00\x12X\n\x13\x66ile_import_request\x18\x06 \x01(\x0b\x32\x39.sass.embedded_protocol.OutboundMessage.FileImportRequestH\x00\x12\\\n\x15\x66unction_call_request\x18\x07 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.FunctionCallRequestH\x00\x12S\n\x10version_response\x18\x08 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.VersionResponseH\x00\x1a\x8e\x01\n\x0fVersionResponse\x12\n\n\x02id\x18\x05 \x01(\r\x12\x18\n\x10protocol_version\x18\x01 \x01(\t\x12\x18\n\x10\x63ompiler_version\x18\x02 \x01(\t\x12\x1e\n\x16implementation_version\x18\x03 \x01(\t\x12\x1b\n\x13implementation_name\x18\x04 \x01(\t\x1a\xa2\x03\n\x0f\x43ompileResponse\x12Y\n\x07success\x18\x02 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccessH\x00\x12Y\n\x07\x66\x61ilure\x18\x03 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailureH\x00\x12\x13\n\x0bloaded_urls\x18\x04 \x03(\t\x1a\x37\n\x0e\x43ompileSuccess\x12\x0b\n\x03\x63ss\x18\x01 \x01(\t\x12\x12\n\nsource_map\x18\x02 \x01(\tJ\x04\x08\x03\x10\x04\x1a{\n\x0e\x43ompileFailure\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x30\n\x04span\x18\x02 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpan\x12\x13\n\x0bstack_trace\x18\x03 \x01(\t\x12\x11\n\tformatted\x18\x04 \x01(\tB\x08\n\x06resultJ\x04\x08\x01\x10\x02\x1a\xbd\x01\n\x08LogEvent\x12\x32\n\x04type\x18\x02 \x01(\x0e\x32$.sass.embedded_protocol.LogEventType\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x35\n\x04span\x18\x04 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpanH\x00\x88\x01\x01\x12\x13\n\x0bstack_trace\x18\x05 \x01(\t\x12\x11\n\tformatted\x18\x06 \x01(\tB\x07\n\x05_spanJ\x04\x08\x01\x10\x02\x1a\x8e\x01\n\x13\x43\x61nonicalizeRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x43\n\rImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\tJ\x04\x08\x02\x10\x03\x1a\x8c\x01\n\x11\x46ileImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x8e\x01\n\x13\x46unctionCallRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x66unction_id\x18\x04 \x01(\rH\x00\x12\x30\n\targuments\x18\x05 \x03(\x0b\x32\x1d.sass.embedded_protocol.ValueB\x0c\n\nidentifierJ\x04\x08\x02\x10\x03\x42\t\n\x07message\"e\n\rProtocolError\x12\x37\n\x04type\x18\x01 \x01(\x0e\x32).sass.embedded_protocol.ProtocolErrorType\x12\n\n\x02id\x18\x02 \x01(\r\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x87\x02\n\nSourceSpan\x12\x0c\n\x04text\x18\x01 \x01(\t\x12@\n\x05start\x18\x02 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocation\x12\x43\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocationH\x00\x88\x01\x01\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x05 \x01(\t\x1a>\n\x0eSourceLocation\x12\x0e\n\x06offset\x18\x01 \x01(\r\x12\x0c\n\x04line\x18\x02 \x01(\r\x12\x0e\n\x06\x63olumn\x18\x03 \x01(\rB\x06\n\x04_end\"\xb8\x13\n\x05Value\x12\x36\n\x06string\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.StringH\x00\x12\x36\n\x06number\x18\x02 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12;\n\trgb_color\x18\x03 \x01(\x0b\x32&.sass.embedded_protocol.Value.RgbColorH\x00\x12;\n\thsl_color\x18\x04 \x01(\x0b\x32&.sass.embedded_protocol.Value.HslColorH\x00\x12\x32\n\x04list\x18\x05 \x01(\x0b\x32\".sass.embedded_protocol.Value.ListH\x00\x12\x30\n\x03map\x18\x06 \x01(\x0b\x32!.sass.embedded_protocol.Value.MapH\x00\x12;\n\tsingleton\x18\x07 \x01(\x0e\x32&.sass.embedded_protocol.SingletonValueH\x00\x12K\n\x11\x63ompiler_function\x18\x08 \x01(\x0b\x32..sass.embedded_protocol.Value.CompilerFunctionH\x00\x12\x43\n\rhost_function\x18\t \x01(\x0b\x32*.sass.embedded_protocol.Value.HostFunctionH\x00\x12\x43\n\rargument_list\x18\n \x01(\x0b\x32*.sass.embedded_protocol.Value.ArgumentListH\x00\x12;\n\thwb_color\x18\x0b \x01(\x0b\x32&.sass.embedded_protocol.Value.HwbColorH\x00\x12@\n\x0b\x63\x61lculation\x18\x0c \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x12\x45\n\x0e\x63ompiler_mixin\x18\r \x01(\x0b\x32+.sass.embedded_protocol.Value.CompilerMixinH\x00\x1a&\n\x06String\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0e\n\x06quoted\x18\x02 \x01(\x08\x1a\x41\n\x06Number\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x12\n\nnumerators\x18\x02 \x03(\t\x12\x14\n\x0c\x64\x65nominators\x18\x03 \x03(\t\x1a\x43\n\x08RgbColor\x12\x0b\n\x03red\x18\x01 \x01(\r\x12\r\n\x05green\x18\x02 \x01(\r\x12\x0c\n\x04\x62lue\x18\x03 \x01(\r\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aM\n\x08HslColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x12\n\nsaturation\x18\x02 \x01(\x01\x12\x11\n\tlightness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aL\n\x08HwbColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x11\n\twhiteness\x18\x02 \x01(\x01\x12\x11\n\tblackness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1a\x87\x01\n\x04List\x12\x38\n\tseparator\x18\x01 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12\x14\n\x0chas_brackets\x18\x02 \x01(\x08\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\xa2\x01\n\x03Map\x12\x38\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\'.sass.embedded_protocol.Value.Map.Entry\x1a\x61\n\x05\x45ntry\x12*\n\x03key\x18\x01 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\x1e\n\x10\x43ompilerFunction\x12\n\n\x02id\x18\x01 \x01(\r\x1a-\n\x0cHostFunction\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\t\x1a\x1b\n\rCompilerMixin\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xa1\x02\n\x0c\x41rgumentList\x12\n\n\x02id\x18\x01 \x01(\r\x12\x38\n\tseparator\x18\x02 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x12J\n\x08keywords\x18\x04 \x03(\x0b\x32\x38.sass.embedded_protocol.Value.ArgumentList.KeywordsEntry\x1aN\n\rKeywordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value:\x02\x38\x01\x1a\xef\x04\n\x0b\x43\x61lculation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\targuments\x18\x02 \x03(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x1a\x95\x02\n\x10\x43\x61lculationValue\x12\x36\n\x06number\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12\x10\n\x06string\x18\x02 \x01(\tH\x00\x12\x17\n\rinterpolation\x18\x03 \x01(\tH\x00\x12S\n\toperation\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.Value.Calculation.CalculationOperationH\x00\x12@\n\x0b\x63\x61lculation\x18\x05 \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x42\x07\n\x05value\x1a\xea\x01\n\x14\x43\x61lculationOperation\x12=\n\x08operator\x18\x01 \x01(\x0e\x32+.sass.embedded_protocol.CalculationOperator\x12H\n\x04left\x18\x02 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x12I\n\x05right\x18\x03 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValueB\x07\n\x05value\"4\n\x13NodePackageImporter\x12\x1d\n\x15\x65ntry_point_directory\x18\x01 \x01(\t*+\n\x0bOutputStyle\x12\x0c\n\x08\x45XPANDED\x10\x00\x12\x0e\n\nCOMPRESSED\x10\x01*)\n\x06Syntax\x12\x08\n\x04SCSS\x10\x00\x12\x0c\n\x08INDENTED\x10\x01\x12\x07\n\x03\x43SS\x10\x02*?\n\x0cLogEventType\x12\x0b\n\x07WARNING\x10\x00\x12\x17\n\x13\x44\x45PRECATION_WARNING\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x02*8\n\x11ProtocolErrorType\x12\t\n\x05PARSE\x10\x00\x12\n\n\x06PARAMS\x10\x01\x12\x0c\n\x08INTERNAL\x10\x02*?\n\rListSeparator\x12\t\n\x05\x43OMMA\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\t\n\x05SLASH\x10\x02\x12\r\n\tUNDECIDED\x10\x03*/\n\x0eSingletonValue\x12\x08\n\x04TRUE\x10\x00\x12\t\n\x05\x46\x41LSE\x10\x01\x12\x08\n\x04NULL\x10\x02*A\n\x13\x43\x61lculationOperator\x12\x08\n\x04PLUS\x10\x00\x12\t\n\x05MINUS\x10\x01\x12\t\n\x05TIMES\x10\x02\x12\n\n\x06\x44IVIDE\x10\x03\x42#\n\x1f\x63om.sass_lang.embedded_protocolP\x01\x62\x06proto3"
9
9
 
10
10
  pool = Google::Protobuf::DescriptorPool.generated_pool
11
11
 
@@ -72,6 +72,7 @@ module Sass
72
72
  Value::Calculation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation").msgclass
73
73
  Value::Calculation::CalculationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation.CalculationValue").msgclass
74
74
  Value::Calculation::CalculationOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation.CalculationOperation").msgclass
75
+ NodePackageImporter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.NodePackageImporter").msgclass
75
76
  OutputStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.OutputStyle").enummodule
76
77
  Syntax = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Syntax").enummodule
77
78
  LogEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.LogEventType").enummodule
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "1.69.7"
3
+ "sass": "1.71.0"
4
4
  }
5
5
  }
@@ -13,9 +13,9 @@ module Sass
13
13
  attr_reader :from_import
14
14
 
15
15
  # @!visibility private
16
- def initialize(containing_url, from_import)
17
- @containing_url = containing_url
18
- @from_import = from_import
16
+ def initialize(canonicalize_request)
17
+ @containing_url = canonicalize_request.containing_url == '' ? nil : canonicalize_request.containing_url
18
+ @from_import = canonicalize_request.from_import
19
19
  end
20
20
  end
21
21
  end
@@ -2,10 +2,10 @@
2
2
 
3
3
  module Sass
4
4
  class Compiler
5
- # The {DispatcherManager} class.
5
+ # The {Channel} class.
6
6
  #
7
7
  # It manages the lifecycle of {Dispatcher}.
8
- class DispatcherManager
8
+ class Channel
9
9
  def initialize(dispatcher_class)
10
10
  @dispatcher_class = dispatcher_class
11
11
  @dispatcher = @dispatcher_class.new
@@ -27,18 +27,42 @@ module Sass
27
27
  end
28
28
  end
29
29
 
30
- def connect(...)
30
+ def stream(host)
31
31
  @mutex.synchronize do
32
32
  raise IOError, 'closed compiler' if @dispatcher.nil?
33
33
 
34
- @dispatcher.connect(...)
34
+ Stream.new(@dispatcher, host)
35
35
  rescue Errno::EBUSY
36
36
  @dispatcher = @dispatcher_class.new
37
- @dispatcher.connect(...)
37
+ Stream.new(@dispatcher, host)
38
38
  end
39
39
  end
40
+
41
+ # The {Stream} between {Dispatcher} and {Host}.
42
+ class Stream
43
+ attr_reader :id
44
+
45
+ def initialize(dispatcher, host)
46
+ @dispatcher = dispatcher
47
+ @id = @dispatcher.subscribe(host)
48
+ end
49
+
50
+ def close
51
+ @dispatcher.unsubscribe(@id)
52
+ end
53
+
54
+ def error(...)
55
+ @dispatcher.error(...)
56
+ end
57
+
58
+ def send_proto(...)
59
+ @dispatcher.send_proto(...)
60
+ end
61
+ end
62
+
63
+ private_constant :Stream
40
64
  end
41
65
 
42
- private_constant :DispatcherManager
66
+ private_constant :Channel
43
67
  end
44
68
  end
@@ -8,7 +8,7 @@ module Sass
8
8
  class Dispatcher
9
9
  def initialize
10
10
  @id = 1
11
- @observers = {}
11
+ @observers = {}.compare_by_identity
12
12
  @mutex = Mutex.new
13
13
  @connection = Connection.new(self)
14
14
  ForkTracker.add(self)
@@ -41,10 +41,6 @@ module Sass
41
41
  end
42
42
  end
43
43
 
44
- def connect(host)
45
- Channel.new(self, host)
46
- end
47
-
48
44
  def close
49
45
  @mutex.synchronize do
50
46
  _close
@@ -112,30 +108,6 @@ module Sass
112
108
  def _idle?
113
109
  @id == 1
114
110
  end
115
-
116
- # The {Channel} between {Dispatcher} and {Host}.
117
- class Channel
118
- attr_reader :id
119
-
120
- def initialize(dispatcher, host)
121
- @dispatcher = dispatcher
122
- @id = @dispatcher.subscribe(host)
123
- end
124
-
125
- def disconnect
126
- @dispatcher.unsubscribe(@id)
127
- end
128
-
129
- def error(...)
130
- @dispatcher.error(...)
131
- end
132
-
133
- def send_proto(...)
134
- @dispatcher.send_proto(...)
135
- end
136
- end
137
-
138
- private_constant :Channel
139
111
  end
140
112
 
141
113
  private_constant :Dispatcher
@@ -23,30 +23,39 @@ module Sass
23
23
  end
24
24
 
25
25
  @id = 0
26
- @functions_by_id = {}
27
- @ids_by_function = {}
26
+ @functions_by_id = {}.compare_by_identity
27
+ @ids_by_function = {}.compare_by_identity
28
28
 
29
29
  @highlight = alert_color
30
30
  end
31
31
 
32
32
  def register(function)
33
- return if @ids_by_function.key?(function)
33
+ @ids_by_function.fetch(function) do |fn|
34
+ id = @id
35
+ @id = id.next
34
36
 
35
- id = @id
36
- @id = id.next
37
-
38
- @ids_by_function[function] = id
39
- @functions_by_id[id] = function
40
-
41
- id
37
+ @functions_by_id[id] = fn
38
+ @ids_by_function[fn] = id
39
+ end
42
40
  end
43
41
 
44
42
  def function_call(function_call_request)
43
+ oneof = function_call_request.identifier
44
+ identifier = function_call_request.public_send(oneof)
45
+ function = case oneof
46
+ when :name
47
+ @functions_by_name[identifier]
48
+ when :function_id
49
+ @functions_by_id[identifier]
50
+ else
51
+ raise ArgumentError, "Unknown FunctionCallRequest.identifier #{identifier}"
52
+ end
53
+
45
54
  arguments = function_call_request.arguments.map do |argument|
46
- value_protofier.from_proto(argument)
55
+ protofier.from_proto(argument)
47
56
  end
48
57
 
49
- success = value_protofier.to_proto(get(function_call_request).call(arguments))
58
+ success = protofier.to_proto(function.call(arguments))
50
59
  accessed_argument_lists = arguments.filter_map do |argument|
51
60
  if argument.is_a?(Sass::Value::ArgumentList) && argument.instance_eval { @keywords_accessed }
52
61
  argument.instance_eval { @id }
@@ -67,17 +76,8 @@ module Sass
67
76
 
68
77
  private
69
78
 
70
- def get(function_call_request)
71
- case function_call_request.identifier
72
- when :name
73
- @functions_by_name[function_call_request.name]
74
- when :function_id
75
- @functions_by_id[function_call_request.function_id]
76
- end
77
- end
78
-
79
- def value_protofier
80
- @value_protofier ||= ValueProtofier.new(self)
79
+ def protofier
80
+ @protofier ||= Protofier.new(self)
81
81
  end
82
82
  end
83
83
 
@@ -11,7 +11,7 @@ module Sass
11
11
 
12
12
  def initialize(importers, load_paths, alert_color:)
13
13
  @id = 0
14
- @importers_by_id = {}
14
+ @importers_by_id = {}.compare_by_identity
15
15
  @importers = importers
16
16
  .map { |importer| register(importer) }
17
17
  .concat(
@@ -26,42 +26,50 @@ module Sass
26
26
  end
27
27
 
28
28
  def register(importer)
29
- importer = Structifier.to_struct(importer, :canonicalize, :load, :non_canonical_scheme, :find_file_url)
29
+ if importer.is_a?(Sass::NodePackageImporter)
30
+ EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
31
+ node_package_importer: EmbeddedProtocol::NodePackageImporter.new(
32
+ entry_point_directory: importer.instance_eval { @entry_point_directory }
33
+ )
34
+ )
35
+ else
36
+ importer = Structifier.to_struct(importer, :canonicalize, :load, :non_canonical_scheme, :find_file_url)
30
37
 
31
- is_importer = importer.respond_to?(:canonicalize) && importer.respond_to?(:load)
32
- is_file_importer = importer.respond_to?(:find_file_url)
38
+ is_importer = importer.respond_to?(:canonicalize) && importer.respond_to?(:load)
39
+ is_file_importer = importer.respond_to?(:find_file_url)
33
40
 
34
- raise ArgumentError, 'importer must be an Importer or a FileImporter' if is_importer == is_file_importer
41
+ raise ArgumentError, 'importer must be an Importer or a FileImporter' if is_importer == is_file_importer
35
42
 
36
- id = @id
37
- @id = id.next
43
+ id = @id
44
+ @id = id.next
38
45
 
39
- @importers_by_id[id] = importer
40
- if is_importer
41
- EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
42
- importer_id: id,
43
- non_canonical_scheme: if importer.respond_to?(:non_canonical_scheme)
44
- non_canonical_scheme = importer.non_canonical_scheme
45
- if non_canonical_scheme.is_a?(String)
46
- [non_canonical_scheme]
46
+ @importers_by_id[id] = importer
47
+ if is_importer
48
+ EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
49
+ importer_id: id,
50
+ non_canonical_scheme: if importer.respond_to?(:non_canonical_scheme)
51
+ non_canonical_scheme = importer.non_canonical_scheme
52
+ if non_canonical_scheme.is_a?(String)
53
+ [non_canonical_scheme]
54
+ else
55
+ non_canonical_scheme || []
56
+ end
47
57
  else
48
- non_canonical_scheme || []
58
+ []
49
59
  end
50
- else
51
- []
52
- end
53
- )
54
- else
55
- EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
56
- file_importer_id: id
57
- )
60
+ )
61
+ else
62
+ EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
63
+ file_importer_id: id
64
+ )
65
+ end
58
66
  end
59
67
  end
60
68
 
61
69
  def canonicalize(canonicalize_request)
62
70
  importer = @importers_by_id[canonicalize_request.importer_id]
63
71
  url = importer.canonicalize(canonicalize_request.url,
64
- Protofier.from_proto_canonicalize_context(canonicalize_request))&.to_s
72
+ CanonicalizeContext.new(canonicalize_request))&.to_s
65
73
 
66
74
  EmbeddedProtocol::InboundMessage::CanonicalizeResponse.new(
67
75
  id: canonicalize_request.id,
@@ -82,7 +90,7 @@ module Sass
82
90
  id: import_request.id,
83
91
  success: EmbeddedProtocol::InboundMessage::ImportResponse::ImportSuccess.new(
84
92
  contents: importer_result.contents.to_str,
85
- syntax: Protofier.to_proto_syntax(importer_result.syntax),
93
+ syntax: syntax_to_proto(importer_result.syntax),
86
94
  source_map_url: (importer_result.source_map_url&.to_s if importer_result.respond_to?(:source_map_url))
87
95
  )
88
96
  )
@@ -96,7 +104,7 @@ module Sass
96
104
  def file_import(file_import_request)
97
105
  importer = @importers_by_id[file_import_request.importer_id]
98
106
  file_url = importer.find_file_url(file_import_request.url,
99
- Protofier.from_proto_canonicalize_context(file_import_request))&.to_s
107
+ CanonicalizeContext.new(file_import_request))&.to_s
100
108
 
101
109
  EmbeddedProtocol::InboundMessage::FileImportResponse.new(
102
110
  id: file_import_request.id,
@@ -108,6 +116,19 @@ module Sass
108
116
  error: e.full_message(highlight: @highlight, order: :top)
109
117
  )
110
118
  end
119
+
120
+ def syntax_to_proto(syntax)
121
+ case syntax&.to_sym
122
+ when :scss
123
+ EmbeddedProtocol::Syntax::SCSS
124
+ when :indented
125
+ EmbeddedProtocol::Syntax::INDENTED
126
+ when :css
127
+ EmbeddedProtocol::Syntax::CSS
128
+ else
129
+ raise ArgumentError, 'syntax must be one of :scss, :indented, :css'
130
+ end
131
+ end
111
132
  end
112
133
 
113
134
  private_constant :ImporterRegistry
@@ -13,7 +13,7 @@ module Sass
13
13
  if logger.respond_to?(:debug)
14
14
  define_singleton_method(:debug) do |event|
15
15
  logger.debug(event.message,
16
- span: Protofier.from_proto_source_span(event.span))
16
+ span: event.span.nil? ? nil : Logger::SourceSpan.new(event.span))
17
17
  end
18
18
  end
19
19
 
@@ -21,7 +21,7 @@ module Sass
21
21
  define_singleton_method(:warn) do |event|
22
22
  logger.warn(event.message,
23
23
  deprecation: event.type == :DEPRECATION_WARNING,
24
- span: Protofier.from_proto_source_span(event.span),
24
+ span: event.span.nil? ? nil : Logger::SourceSpan.new(event.span),
25
25
  stack: event.stack_trace)
26
26
  end
27
27
  end
@@ -33,6 +33,8 @@ module Sass
33
33
  debug(event)
34
34
  when :DEPRECATION_WARNING, :WARNING
35
35
  warn(event)
36
+ else
37
+ raise ArgumentError, "Unknown LogEvent.type #{event.type}"
36
38
  end
37
39
  end
38
40