suada 1.0.0.rc.1 → 1.0.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: 1b0f4b6d07f48d6e7a3631c6394357729c41d1148cbf1d635952698dff189873
4
- data.tar.gz: 24070920a0790ca63ed4b35d62c8a02474e0c637935499e84eb872797b9390b1
3
+ metadata.gz: 64ca1a530119ed27755004b493ae86ccbeca64181b1579665f7f6a2d1a46e3de
4
+ data.tar.gz: 937e2af1eba7118b4d8cccb59477179f9445f4779a7e4d5081093adbed69999c
5
5
  SHA512:
6
- metadata.gz: b1f830e411522ce48551e87481d329761cea331a13b86066157871a1e449535e94a8af3c715da8585281c81746a3401e32acbb194edbc23a8a8c9945b8ee58ec
7
- data.tar.gz: f3bec6bafd02c087c77bb7fc12b601079753c15c0c513e3db1c6345c7fbfb9ed286bf520036d88caa677d8ba29bad5d9b6b9ef13a51f0243295fa1a92dc6661a
6
+ metadata.gz: e1d3edeb4317c878128e32caa1bd82948a624d9beb514b3156f57d4db90bac860dd0968bfa0dc7bf7ccb3368ddef7ffd4ca49823e8b22f588474a5637886d2db
7
+ data.tar.gz: 4954733eea4953de1ec961efca75fbc94cf0997924708d4b0bb686185e8ced58276af89dff12173c01e204803c0571565b32b8c4a29df39610b77cab81dc30ea
@@ -6,18 +6,20 @@ The 1.0 acceptance matrix covers the two newest stable browser releases on the l
6
6
 
7
7
  | Browser | macOS | Windows | Linux |
8
8
  | --- | --- | --- | --- |
9
- | Chrome | Chrome 158.0.8127.108 on macOS 26.3 passed the browser suite. Chromium 159.0.8154.6 also passed the viewer smoke test. | Native browser coverage pending. Windows CI passed CLI and LSP path checks. | Chrome runs in CI. Two-release coverage pending. |
10
- | Firefox | The Playwright Firefox 159.0 build passed the viewer smoke test. Two stable Firefox releases are pending. | Both releases pending. | The Playwright smoke test runs in CI. Two stable releases are pending. |
9
+ | Chrome | Chrome 158.0.8127.108 passed the browser suite. Chrome Headless Shell 157.0.8103.78 passed the step navigation and motion tests. | Chrome Headless Shell 157.0.8103.78 and 158.0.8127.107 passed the viewer smoke test. | Chrome Headless Shell 157.0.8103.78 and 158.0.8127.107 passed the viewer smoke test. |
10
+ | Firefox | Firefox 160.0.1 and 161.0.1 passed the viewer smoke test. | Firefox 160.0.1 and 161.0.1 passed the viewer smoke test. | Firefox 160.0.1 and 161.0.1 passed the viewer smoke test. |
11
11
  | Safari | Safari 26.3 on macOS 26.3 opened a published deck at step 2 and returned to step 1 by keyboard. The accessibility tree exposed the slide heading, position and navigation controls. Playwright WebKit 27.2 passed the viewer smoke test. Coverage of the two newest native releases is pending. | No supported release. | No supported release. |
12
12
 
13
- The [browser compatibility workflow](../.github/workflows/browser-compatibility.yml) exercises Chromium, Firefox and WebKit on Linux and macOS. It checks direct links to a step, keyboard navigation and reduced motion.
13
+ The [browser compatibility workflow](../.github/workflows/browser-compatibility.yml) exercises Chromium, Firefox and WebKit on Linux, macOS and Windows. It checks direct links to a step, keyboard navigation and reduced motion.
14
+
15
+ The macOS 26.3 and Debian 13 (arm64) tests use the 1.0.0.rc.1 source. The [Windows Server 2025 tests](https://github.com/ydah/suada/actions/runs/47599114668) use the RC source with the [Windows export fix](https://github.com/ydah/suada/pull/12). The viewer smoke test opens a direct step link, returns to the preceding step and jumps to the opening slide by keyboard with reduced motion enabled.
14
16
 
15
17
  ## Accessibility checks
16
18
 
17
19
  - Keyboard in the audience viewer and preview. Advance and return with the arrow keys, open the outline as a link, and use `O` to open the preview's slide overview. In presenter mode, `?` opens keyboard help.
18
20
  - Text alternatives. Use a descriptive title and image descriptions. The viewer provides a text outline and labels the slide controls. PDF export includes document tags and bookmarks.
19
21
  - Reduced motion. The automated Chrome cases check that the final slide, glyphs, marks and callouts appear without active transitions when the browser reports a reduced-motion preference.
20
- - Screen reader. Verify the active slide heading and position announcement, control names, and focus restoration with VoiceOver, Narrator or NVDA. Manual assistive-technology verification is pending.
22
+ - Screen reader. Orca 48.1 with Firefox ESR on Debian 13 logged the active slide heading, the outline link, and both navigation button names. Activating Next by keyboard produced the new position announcement, and heading navigation reached the new slide heading. Audible playback, focus restoration, and checks with VoiceOver, Narrator or NVDA remain pending.
21
23
 
22
24
  See the [presentation checklist](e2e-checklist.md) for rehearsal results and venue checks.
23
25
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "webrick"
4
4
  require "tempfile"
5
+ require_relative "output_lock"
5
6
 
6
7
  module Suada
7
8
  module BrowserOutput
@@ -60,8 +61,7 @@ module Suada
60
61
  File.binwrite(File.join(stage, name), bytes)
61
62
  end
62
63
  marker = ".suada-#{format}-images"
63
- File.open(target, File::RDONLY) do |lock|
64
- lock.flock(File::LOCK_EX)
64
+ OutputLock.synchronize(target) do
65
65
  manifest = File.join(target, marker)
66
66
  if File.symlink?(manifest) || (File.exist?(manifest) && !File.file?(manifest))
67
67
  raise UsageError, "invalid image manifest: #{manifest}"
@@ -127,22 +127,22 @@ module Suada
127
127
  file = relative_file(error, base_dir)
128
128
  if file
129
129
  span = error.diagnostic.span
130
- location = { artifactLocation: { uri: uri_path(file.to_s), uriBaseId: "%SRCROOT%" } } #: Hash[Symbol, untyped]
130
+ artifact = file.absolute? ? { uri: file_uri(file.to_s) } : { uri: uri_path(file.to_s), uriBaseId: "%SRCROOT%" }
131
+ location = { artifactLocation: artifact } #: Hash[Symbol, untyped]
131
132
  region = { startLine: span.line, startColumn: span.column, endLine: span.end_line, endColumn: span.end_column }.compact
132
133
  location[:region] = region if span.line
133
134
  result[:locations] = [{ physicalLocation: location }]
134
135
  end
135
136
  result
136
137
  end
137
- root = uri_path(File.expand_path(base_dir))
138
- root = "/#{root.sub(/\A([A-Za-z])%3A/, '\1:')}" unless root.start_with?("/")
138
+ root = file_uri(File.expand_path(base_dir))
139
139
  root += "/" unless root.end_with?("/")
140
140
  JSON.generate(
141
141
  "$schema" => "https://json.schemastore.org/sarif-2.1.0.json",
142
142
  "version" => "2.1.0",
143
143
  "runs" => [{
144
144
  tool: { driver: { name: "Suada", informationUri: "https://github.com/ydah/suada", rules: } },
145
- originalUriBaseIds: { "%SRCROOT%" => { uri: "file://#{root}" } },
145
+ originalUriBaseIds: { "%SRCROOT%" => { uri: root } },
146
146
  results:
147
147
  }]
148
148
  )
@@ -150,11 +150,25 @@ module Suada
150
150
 
151
151
  def self.uri_path(path) = URI.encode_uri_component(path).gsub("%2F", "/")
152
152
 
153
+ def self.file_uri(path)
154
+ encoded = uri_path(path)
155
+ return "file:#{encoded}" if encoded.start_with?("//")
156
+
157
+ encoded = "/#{encoded.sub(/\A([A-Za-z])%3A/, '\1:')}" unless encoded.start_with?("/")
158
+ "file://#{encoded}"
159
+ end
160
+
153
161
  def self.relative_file(error, base_dir)
154
162
  return unless error.file
155
163
 
156
- Pathname(File.expand_path(error.file, base_dir)).relative_path_from(Pathname(File.expand_path(base_dir)))
164
+ file = Pathname(File.expand_path(error.file, base_dir))
165
+ base = Pathname(File.expand_path(base_dir))
166
+ begin
167
+ file.relative_path_from(base)
168
+ rescue ArgumentError
169
+ file
170
+ end
157
171
  end
158
- private_class_method :relative_file, :github, :github_escape, :sarif, :uri_path
172
+ private_class_method :relative_file, :github, :github_escape, :sarif, :uri_path, :file_uri
159
173
  end
160
174
  end
@@ -4,6 +4,7 @@ require "digest"
4
4
  require "fileutils"
5
5
  require "tmpdir"
6
6
  require "pathname"
7
+ require_relative "../output_lock"
7
8
  require_relative "static"
8
9
 
9
10
  module Suada
@@ -35,12 +36,12 @@ module Suada
35
36
  File.write(File.join(stage, "manifest.json"), JSON.pretty_generate(manifest) + "\n")
36
37
  File.write(File.join(stage, "suada.css"), rendered.css)
37
38
  FileUtils.cp(%w[viewer.js motion.js].map { |f| File.join(ASSETS, f) }, stage)
38
- File.write(File.join(stage, "outline.html"), Static.outline(rendered))
39
+ File.binwrite(File.join(stage, "outline.html"), Static.outline(rendered))
39
40
  if cover
40
41
  require_relative "../browser_output"
41
42
  cover = BrowserOutput.cover(rendered, stage)
42
43
  end
43
- File.write(File.join(stage, "index.html"), Static.index(rendered, cover: cover))
44
+ File.binwrite(File.join(stage, "index.html"), Static.index(rendered, cover: cover))
44
45
  install(stage, path)
45
46
  end
46
47
  Result.new(path, rendered.slides.size)
@@ -53,8 +54,7 @@ module Suada
53
54
  raise UsageError, "output must be a directory: #{path}"
54
55
  end
55
56
  FileUtils.mkdir_p(path)
56
- File.open(path, File::RDONLY) do |dir|
57
- dir.flock(File::LOCK_EX)
57
+ OutputLock.synchronize(path.to_s) do
58
58
  replace_files(stage, path)
59
59
  end
60
60
  end
@@ -3,6 +3,7 @@
3
3
  require "tempfile"
4
4
  require "fileutils"
5
5
  require "digest"
6
+ require_relative "../output_lock"
6
7
 
7
8
  module Suada
8
9
  module Emitter
@@ -131,12 +132,12 @@ module Suada
131
132
  def self.save(path, html)
132
133
  parent = File.dirname(path)
133
134
  FileUtils.mkdir_p(parent)
134
- File.open(parent, File::RDONLY) do |dir|
135
- dir.flock(File::LOCK_EX)
135
+ OutputLock.synchronize(parent) do
136
136
  if (File.exist?(path) || File.symlink?(path)) && !generated?(path)
137
137
  raise UsageError, "output contains an existing file: #{path}"
138
138
  end
139
139
  Tempfile.create(".suada-html-", parent) do |file|
140
+ file.binmode
140
141
  file.write(html)
141
142
  file.chmod(0o666 & ~File.umask)
142
143
  file.close
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "digest"
4
+ require "fileutils"
5
+ require "tmpdir"
6
+
7
+ module Suada
8
+ module OutputLock
9
+ def self.synchronize(directory)
10
+ if Gem.win_platform?
11
+ # Windows cannot flock a directory. Keep the lock out of the exported files.
12
+ lock_dir = File.join(ENV.fetch("LOCALAPPDATA") { Dir.tmpdir }, "Suada", "locks")
13
+ FileUtils.mkdir_p(lock_dir)
14
+ identity = Digest::SHA256.hexdigest(File.realpath(directory).downcase)
15
+ path = File.join(lock_dir, identity)
16
+ mode = File::RDWR | File::CREAT
17
+ else
18
+ path = directory
19
+ mode = File::RDONLY
20
+ end
21
+ File.open(path, mode, 0o600) do |lock|
22
+ lock.flock(File::LOCK_EX)
23
+ yield
24
+ end
25
+ end
26
+ end
27
+ end
data/lib/suada/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Suada
4
- VERSION = "1.0.0.rc.1"
4
+ VERSION = "1.0.0"
5
5
  end
data/sig/parser.rbs CHANGED
@@ -86,6 +86,7 @@ module Suada
86
86
  def self.github_escape: (String) -> String
87
87
  def self.sarif: (Array[BuildError], base_dir: string) -> String
88
88
  def self.uri_path: (String) -> String
89
+ def self.file_uri: (String) -> String
89
90
  end
90
91
 
91
92
  class Source < Data
data/sig/suada.rbs CHANGED
@@ -4,6 +4,10 @@ module Suada
4
4
  def self.compile: (?string path) -> Deck::Rendered
5
5
  def self.build: (?string path, ?out: string | Pathname) -> Emitter::Distribution::Result
6
6
 
7
+ module OutputLock
8
+ def self.synchronize: [T] (String) { () -> T } -> T
9
+ end
10
+
7
11
  module Emitter
8
12
  module Static
9
13
  MARKER: String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suada
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ydah
@@ -169,6 +169,7 @@ files:
169
169
  - lib/suada/motion/diff.rb
170
170
  - lib/suada/motion/glyphs.rb
171
171
  - lib/suada/motion/keyer.rb
172
+ - lib/suada/output_lock.rb
172
173
  - lib/suada/parser.rb
173
174
  - lib/suada/parser/block_classifier.rb
174
175
  - lib/suada/parser/code_attributes.rb