trmnl_preview 0.32.2 → 0.33.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: d9cf02342886e42a2a4b60b068657e4f58b446226febe78f8b8bcfa7758a8d54
4
- data.tar.gz: 3d63d0f368a43254e0fd6b1ae134559ec58be55c1179fbc33a603ebcfd561e05
3
+ metadata.gz: 5fd004c073c92482786ba93d06f11ec63600ed083fafe9189e650027dd7a64ad
4
+ data.tar.gz: 9dc3339ca7d9db5c4cb65811a4d11717b41eb49ff80299fb65b51b1927b94877
5
5
  SHA512:
6
- metadata.gz: 5ab520c731381e951386bb168172c268a91732e94890e89a886dc685f5a980662b33ba6735138aa93374e96810dc1e405bb084b017debe6abb632dd72a9d152d
7
- data.tar.gz: 4033ff9382961fa5b6500e3eea051b42bef94c2c73afbedd89a2a6e2d06f3d690a3ddb37fc63df96d642912a463310fcf49e1f6766b21da90b7ee02e0bc099d5
6
+ metadata.gz: 9fbd3ab89f076dc482c719b15643f6425f0842d9a58e8b2409ed810f65a759b34495f4bf7ba0c137e09a7b45c140ae8f2d1bb41e89947ab6416232a12f4051f7
7
+ data.tar.gz: d429df444a6763c911325ee47e729a21e84fedc29f30f06910370572d35758a18ed3149a33b19f7e9ce76729f73fdac27f4eb8a467763d7bde1cde7fd2b78bd8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
 
2
2
  # Changelog
3
3
 
4
+ ## 0.33.0
5
+
6
+ - The Docker image draws Japanese, Chinese and Korean text. It had no CJK font, so that text showed as empty boxes. It now has `fonts-noto-cjk`, the same font TRMNL renders with.
7
+ - `trmnlp lint` reports markup whose `<style>` block draws all the text with no framework element (title, value, label or description), so the text keeps one size on every screen. The rule ID is `framework_elements_used`.
8
+
9
+ ## 0.32.3
10
+
11
+ - The poller refuses a polling URL line that TRMNL refuses, before it sends a request, and gives TRMNL's reason. A line that is not a complete http(s) URL, such as `h` or `//example.com`, has no host because a field it needs is empty, still has a `{{` or `{%`, or has a space or a non-ASCII host. Before, such a line could wait 10 seconds or fail with a connection error that did not say what was wrong.
12
+
4
13
  ## 0.32.2
5
14
 
6
15
  - The Docker image starts again. The 0.32.1 image kept the X display lock from its build in `/tmp`, so the display never started and every command, such as `trmnlp serve` or `trmnlp test`, waited forever. Running with `--tmpfs /tmp` worked around it. A stopped container started again had the same problem, and now clears the lock before the display starts. If the display still does not start, trmnlp stops within 10 seconds and prints why, where it used to wait forever.
data/README.md CHANGED
@@ -573,7 +573,7 @@ By convention, add a matching `CHANGELOG.md` entry in the same change.
573
573
  - [Private Plugins](https://help.trmnl.com/en/articles/9510536-private-plugins): strategies, polling and webhooks
574
574
  - [Liquid 101](https://help.trmnl.com/en/articles/10671186-liquid-101) and the [Framework Design Docs](https://help.trmnl.com/en/articles/12410486-framework-design-docs)
575
575
  - [Custom plugin form builder](https://help.trmnl.com/en/articles/10513740-custom-plugin-form-builder): the form fields `src/settings.yml` declares
576
- - [Syncing Plugins with GitHub](https://help.trmnl.com/en/articles/13465101-syncing-plugins-with-github) and [GitHub Sync](https://help.trmnl.com/en/articles/15977899-github-sync)
576
+ - [GitHub Sync](https://help.trmnl.com/en/articles/15977899-github-sync)
577
577
  - [Recipe best practices](https://help.trmnl.com/en/articles/11395668-recipe-best-practices) and [Demo Data for Publishing Plugins](https://help.trmnl.com/en/articles/12772238-demo-data-for-publishing-plugins)
578
578
  - [TRMNL CLI](https://help.trmnl.com/en/articles/17226209-trmnl-cli): the rest of your account from the terminal
579
579
  - [MCP Server](https://help.trmnl.com/en/articles/17432548-mcp-server) and our [agent skills](https://github.com/usetrmnl/trmnl-agent-skills): build plugins with an AI agent
@@ -1,6 +1,6 @@
1
1
  # Mirrored from the TRMNL design-system source.
2
2
  # Refresh with `rake framework:sync` — do not edit manually.
3
- latest: 3.4.3
3
+ latest: 3.4.4
4
4
  versions:
5
5
  - number: 0.0.1
6
6
  released_at: '2024-06-22'
@@ -100,3 +100,5 @@ versions:
100
100
  released_at: '2026-10-14'
101
101
  - number: 3.4.3
102
102
  released_at: '2026-10-15'
103
+ - number: 3.4.4
104
+ released_at: '2026-10-24'
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../check'
4
+
5
+ module TRMNLP
6
+ module Lint
7
+ module Checks
8
+ # Reports markup that draws all of its text with its own <style> block and no framework
9
+ # element. Art and charts that the framework cannot draw are the reviewer's call.
10
+ class FrameworkElementsUsed < Check
11
+ MESSAGE = 'A <style> block draws all the text and no element uses title, value, label or description, ' \
12
+ 'so the text keeps one size on every screen. Use the framework elements with lg: steps.'
13
+ LEARN_MORE = 'https://trmnl.com/framework/docs/3.4/element_sizes'
14
+ STYLE_BLOCK = /<style\b/i
15
+ ELEMENT = /\A(?:title|value|label|description)(?:--|\z)/
16
+
17
+ private
18
+
19
+ def pass? = source.html_fragments.values.none? { it.at_css('style') } || element_classes?
20
+
21
+ def element_classes? = used_classes.any? { it.split(':').last.to_s.match?(ELEMENT) }
22
+
23
+ def used_classes = source.html_fragments.values.flat_map { it.css('[class]').flat_map { it['class'].split } }
24
+ end
25
+ end
26
+ end
27
+ end
@@ -17,6 +17,7 @@ module TRMNLP
17
17
  'no_external_qr_codes' => Checks::NoExternalQrCodes::PATTERN,
18
18
  'waits_for_dom_load' => Regexp.new(Regexp.union(Checks::WaitsForDomLoad::FORBIDDEN).source, Regexp::IGNORECASE),
19
19
  'limited_inline_styles' => /\sstyle\s*=/i,
20
+ 'framework_elements_used' => Checks::FrameworkElementsUsed::STYLE_BLOCK,
20
21
  'highcharts_animations_disabled' => /highcharts/i,
21
22
  'highcharts_elements_unique' => /highcharts/i
22
23
  }.freeze
data/lib/trmnlp/lint.rb CHANGED
@@ -11,6 +11,7 @@ require_relative 'lint/checks/no_async_functions'
11
11
  require_relative 'lint/checks/waits_for_dom_load'
12
12
  require_relative 'lint/checks/limited_inline_styles'
13
13
  require_relative 'lint/checks/no_style_restyling_framework'
14
+ require_relative 'lint/checks/framework_elements_used'
14
15
  require_relative 'lint/checks/no_size_classes'
15
16
  require_relative 'lint/checks/arbitrary_values_in_range'
16
17
  require_relative 'lint/checks/no_negative_spacing'
@@ -51,6 +52,7 @@ module TRMNLP
51
52
  Checks::WaitsForDomLoad,
52
53
  Checks::LimitedInlineStyles,
53
54
  Checks::NoStyleRestylingFramework,
55
+ Checks::FrameworkElementsUsed,
54
56
  Checks::NoSizeClasses,
55
57
  Checks::ArbitraryValuesInRange,
56
58
  Checks::NoNegativeSpacing,
@@ -37,6 +37,9 @@ module TRMNLP
37
37
  end
38
38
 
39
39
  def call(verb, url, headers:, body:)
40
+ refusal = refusal_reason(encoded(url))
41
+ return [nil, refusal] if refusal
42
+
40
43
  attempts = 0
41
44
  begin
42
45
  attempts += 1
@@ -82,6 +85,22 @@ module TRMNLP
82
85
  connection.get("#{url}#{url.include?('?') ? '&' : '?'}#{body}")
83
86
  end
84
87
 
88
+ # The same urls and words as TRMNL, which refuses these before it sends a request.
89
+ def refusal_reason(url)
90
+ return 'the url still contains an unrendered template tag' if url.match?(/\{\{|\{%/)
91
+
92
+ uri = URI.parse(url)
93
+ return 'the url is not a complete http(s) url' unless %w[http https].include?(uri.scheme&.downcase)
94
+
95
+ 'the url has no host, so a field it needs is probably empty' if uri.hostname.to_s.empty?
96
+ rescue URI::InvalidURIError
97
+ if url.match?(/[^\x00-\x7F]/)
98
+ 'the url host has non-ASCII characters, use its punycode (xn--) form'
99
+ else
100
+ 'the url has a character that must be percent-encoded, such as a space'
101
+ end
102
+ end
103
+
85
104
  def failure_reason(response)
86
105
  return 'the host replied 429 Too Many Requests' if response.status == 429
87
106
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TRMNLP
4
- VERSION = '0.32.2'
4
+ VERSION = '0.33.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trmnl_preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.2
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rockwell Schrock
@@ -431,6 +431,7 @@ files:
431
431
  - lib/trmnlp/lint/checks/files_under_upload_limit.rb
432
432
  - lib/trmnlp/lint/checks/form_fields_valid.rb
433
433
  - lib/trmnlp/lint/checks/framework_classes_exist.rb
434
+ - lib/trmnlp/lint/checks/framework_elements_used.rb
434
435
  - lib/trmnlp/lint/checks/framework_prefixes_exist.rb
435
436
  - lib/trmnlp/lint/checks/gray_text_has_one_bit_class.rb
436
437
  - lib/trmnlp/lint/checks/highcharts_animations_disabled.rb