wabi 0.14.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 822607cf50c26a6b01e02046334337b052b2dda63608170010853b1f7c956c45
4
- data.tar.gz: b62c61579a4d1f3b92468d31615a4e43758f7c350c5f48895890555ddc358aac
3
+ metadata.gz: 624b830e44768bd79a6bf5b9dedaab004b46a4c99e758ce7166e39e8792465f6
4
+ data.tar.gz: a9323e2320b2cf6c9bb2d76bd79557892d7b44ae84302497f4ac47d4263a6838
5
5
  SHA512:
6
- metadata.gz: a0ef5a3acbf22dd7a9160acb27bde9caece017a0502d04247b6c1e273998df6ea01058decad348d7a71ea97e4a7c7012b67738985ee357b5187a8b32e6f125e2
7
- data.tar.gz: 304cc81dee434dc4f01c981da263711173efb30b132b8e8711345c0f527c2c60ac029dbe6b4ec89396a6ed1de8f32e4cea2e124b52bd02ac8bdd57b9c930c93b
6
+ metadata.gz: db129b8e8e4e6d72c9ae28e2f324b61b2a0fd411bfca302087a7ac7f189d3a0aa35845d5b52e1ff55b2e67ea8e054b5f68092594c3fa2af08e3e549cdc93aed0
7
+ data.tar.gz: 70528eaa98b7494320be4eef86d2628fa68e1cf04b007ff7821a7b3e0da34cf098762749965b9133b8a555dcbdb98201baca3b62ae9e3e6506107726d0723489
data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to Wabi land here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## 0.14.1 - 2026-06-02
6
+
7
+ Two blocking install-flow bugs surfaced by end-to-end dogfooding against the live registry.
8
+
9
+ ### Fixed
10
+
11
+ - **Encoding crash on `wabi:add` / `wabi:theme`.** `Net::HTTP` tags response
12
+ bodies `ASCII-8BIT`; writing/caching any component or theme containing a
13
+ multibyte character (e.g. an em-dash in a comment) raised
14
+ `Encoding::UndefinedConversionError` (BINARY→UTF-8) on Ruby 4. The registry
15
+ client and theme generator now `force_encoding("UTF-8")` (on a dup — the body
16
+ is frozen) before writing. This broke the happy path against the live HTTPS
17
+ registry.
18
+ - **Zeitwerk `UI` acronym not registered.** Components install to
19
+ `app/components/ui/` under the `Components::UI` namespace, but Zeitwerk expects
20
+ `Components::Ui`, so a fresh app 500'd on the first component reference.
21
+ `wabi:install` now writes `config/initializers/wabi.rb` registering
22
+ `inflect.acronym "UI"`.
23
+
5
24
  ## 0.14.0 - 2026-06-02
6
25
 
7
26
  The component registry is now live, and the gem points at it by default.
@@ -32,6 +32,23 @@ module Wabi
32
32
  lockfile.save
33
33
  end
34
34
 
35
+ # Components install into app/components/ui/ under the Components::UI
36
+ # namespace. Zeitwerk would expect Components::Ui for the "ui" dir, so the
37
+ # app 500s on the first component reference unless "UI" is a known acronym.
38
+ # Register it (idempotent — skipped if the file already exists).
39
+ def register_ui_acronym
40
+ create_file "config/initializers/wabi.rb", <<~RUBY
41
+ # frozen_string_literal: true
42
+
43
+ # Wabi components live in app/components/ui/ under the Components::UI
44
+ # namespace. Zeitwerk needs the "UI" acronym to map the ui/ directory
45
+ # to the UI constant (otherwise it expects Components::Ui).
46
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
47
+ inflect.acronym "UI"
48
+ end
49
+ RUBY
50
+ end
51
+
35
52
  def print_next_steps
36
53
  say "\n Wabi installed. Next steps:", :green
37
54
  say ""
@@ -39,7 +39,9 @@ module Wabi
39
39
  uri = URI.parse(url_or_path)
40
40
  response = Net::HTTP.get_response(uri)
41
41
  raise Wabi::Error, "Theme #{label} not found at #{url_or_path}: HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
42
- response.body
42
+ # Net::HTTP tags the body ASCII-8BIT; theme CSS is UTF-8 (em-dashes in
43
+ # comments). Force UTF-8 so File.write doesn't raise BINARY→UTF-8.
44
+ response.body.dup.force_encoding("UTF-8")
43
45
  end
44
46
  end
45
47
  end
@@ -57,7 +57,11 @@ module Wabi
57
57
  unless response.is_a?(Net::HTTPSuccess)
58
58
  raise Wabi::Error, "Failed to fetch #{name}: HTTP #{response.code}"
59
59
  end
60
- response.body
60
+ # Net::HTTP tags the body ASCII-8BIT (binary). The registry serves UTF-8
61
+ # JSON, so force the encoding back — otherwise File.write of any component
62
+ # with a multibyte char (e.g. an em-dash in a comment) raises
63
+ # Encoding::UndefinedConversionError (BINARY→UTF-8) on write/cache.
64
+ response.body.dup.force_encoding("UTF-8")
61
65
  end
62
66
 
63
67
  def cache_path(name)
data/lib/wabi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wabi
4
- VERSION = "0.14.0"
4
+ VERSION = "0.14.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wabi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Ortega