wabi 0.13.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 +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +2 -2
- data/lib/wabi/generators/install_generator.rb +17 -0
- data/lib/wabi/generators/theme_generator.rb +4 -2
- data/lib/wabi/lockfile.rb +1 -1
- data/lib/wabi/registry_client.rb +6 -2
- data/lib/wabi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 624b830e44768bd79a6bf5b9dedaab004b46a4c99e758ce7166e39e8792465f6
|
|
4
|
+
data.tar.gz: a9323e2320b2cf6c9bb2d76bd79557892d7b44ae84302497f4ac47d4263a6838
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db129b8e8e4e6d72c9ae28e2f324b61b2a0fd411bfca302087a7ac7f189d3a0aa35845d5b52e1ff55b2e67ea8e054b5f68092594c3fa2af08e3e549cdc93aed0
|
|
7
|
+
data.tar.gz: 70528eaa98b7494320be4eef86d2628fa68e1cf04b007ff7821a7b3e0da34cf098762749965b9133b8a555dcbdb98201baca3b62ae9e3e6506107726d0723489
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
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
|
+
|
|
24
|
+
## 0.14.0 - 2026-06-02
|
|
25
|
+
|
|
26
|
+
The component registry is now live, and the gem points at it by default.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **Default registry URL → `https://wabi-docs.onrender.com/r`** (was the
|
|
31
|
+
not-yet-wired `https://wabikit.dev/r`). The registry is now deployed (the docs
|
|
32
|
+
app on Render serves `/r/*.json` for all 34 components), so
|
|
33
|
+
`bin/rails g wabi:add <name>` works out of the box without
|
|
34
|
+
`wabi:registry`. Override anytime with `bin/rails g wabi:registry <url>`.
|
|
35
|
+
(When `wabikit.dev` is wired to the same service, the default can move back.)
|
|
36
|
+
|
|
5
37
|
## 0.13.0 - 2026-06-01
|
|
6
38
|
|
|
7
39
|
Server-driven DataTable. No breaking changes.
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Wabi is an open-source UI component library for **Ruby on Rails 8**, built on **Phlex + Tailwind 4 + Stimulus + Hotwire**. Inspired by shadcn/ui, components are *copied* into your app — you own the code, customize freely, no upstream API to drift away from.
|
|
6
6
|
|
|
7
|
-
🎉 **Status:** v0.
|
|
7
|
+
🎉 **Status:** v0.14.0 alpha — [available on RubyGems](https://rubygems.org/gems/wabi). 34 components, 8 theme palettes, WCAG-AA targeted, live docs + registry at [wabi-docs.onrender.com](https://wabi-docs.onrender.com).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -106,7 +106,7 @@ That's a fully-accessible modal with focus trap, scroll lock, backdrop click, Es
|
|
|
106
106
|
| `wabi:install [--force]` | Copies `tokens.css`, the `wabi--theme` Stimulus controller, and initializes `config/wabi.lock.json`. `--force` re-copies tokens/controller on gem upgrades (lockfile is preserved). |
|
|
107
107
|
| `wabi:add <name…>` | Copies one or more component source files from the registry into `app/components/ui/` and their controllers into `app/javascript/controllers/wabi/`. Updates the lockfile. |
|
|
108
108
|
| `wabi:list` | Lists all available components in the configured registry. |
|
|
109
|
-
| `wabi:registry <url>` | Switches the active registry origin (default: `https://
|
|
109
|
+
| `wabi:registry <url>` | Switches the active registry origin (default: `https://wabi-docs.onrender.com/r`). |
|
|
110
110
|
| `wabi:theme <slug>` | Swaps `tokens.css` for the requested palette. Run `bin/rails tailwindcss:build` after. |
|
|
111
111
|
|
|
112
112
|
---
|
|
@@ -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 ""
|
|
@@ -14,7 +14,7 @@ module Wabi
|
|
|
14
14
|
|
|
15
15
|
def fetch_and_write
|
|
16
16
|
lockfile = Wabi::Lockfile.load(File.join(destination_root, "config/wabi.lock.json"))
|
|
17
|
-
base = lockfile.registry # e.g. https://
|
|
17
|
+
base = lockfile.registry # e.g. https://wabi-docs.onrender.com/r OR file:///abs/path
|
|
18
18
|
|
|
19
19
|
shared = fetch("#{base}/themes/_shared.css", label: "_shared")
|
|
20
20
|
body = fetch("#{base}/themes/#{slug}.css", label: slug)
|
|
@@ -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
|
-
|
|
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
|
data/lib/wabi/lockfile.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Wabi
|
|
|
7
7
|
# Manages config/wabi.lock.json in a user's Rails app.
|
|
8
8
|
# Tracks installed components, versions, hashes, and registry origin.
|
|
9
9
|
class Lockfile
|
|
10
|
-
DEFAULT_REGISTRY = "https://
|
|
10
|
+
DEFAULT_REGISTRY = "https://wabi-docs.onrender.com/r"
|
|
11
11
|
|
|
12
12
|
attr_reader :path, :registry, :components
|
|
13
13
|
|
data/lib/wabi/registry_client.rb
CHANGED
|
@@ -8,7 +8,7 @@ require_relative "version"
|
|
|
8
8
|
|
|
9
9
|
module Wabi
|
|
10
10
|
class RegistryClient
|
|
11
|
-
DEFAULT_BASE_URL = "https://
|
|
11
|
+
DEFAULT_BASE_URL = "https://wabi-docs.onrender.com/r"
|
|
12
12
|
DEFAULT_TTL = 24 * 60 * 60
|
|
13
13
|
|
|
14
14
|
attr_reader :base_url
|
|
@@ -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
|
-
|
|
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