trmnl_preview 0.10.0 → 0.11.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: 445d3f901f97e586cf2bfeb3dd8286cf2b02cb3c14d8380f50f0d34d35d7d97f
4
- data.tar.gz: e40390fff7ec0ca67127209eacd5de1e096fb800a91148c1068c91aa66748411
3
+ metadata.gz: bdc22b090a3269c3fdbfa52287c287cbab548e6f40aa08428d037903f40dbb5b
4
+ data.tar.gz: 92886e598aa5e83e750bee7fdba8ee1b9d8b5f13fb6c021e2653cfa169900c44
5
5
  SHA512:
6
- metadata.gz: 8bd5fe746adb49697c526ff51256ece9febc2172aa5177af97399a45664f6ce2925f019ed73efdc0bb0515f2405abb45583faf27d8046feb706ccbde9c9e8c46
7
- data.tar.gz: 22ec5594e73ec2903e5f6d83a0b62699cc7cc4543aca6e0bf8f8b5f376dd3418be4ba2b6d2c7d2ef7af63cedb6c451612333a00f5e6dc66dbb60f6f76383cf27
6
+ metadata.gz: d4d8ef476cd8a5f52d49b546eccc28e6e75277cd881d01667ea137c069c15b8a3a93a5029a855ae10ade990f8c8a5ecc61383e7b7f1c5922f0cf71babdf203df
7
+ data.tar.gz: 8b1dfa0578b38e11a317bb47ff3f2985e27236f5199a248431a49acc2f76bd88ed8bac2c6980ab066d19fd3f931ca0f122f8b19501899f2e0e38182cace55f3c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
 
2
2
  # Changelog
3
3
 
4
+ ## 0.11.0
5
+
6
+ - `framework_version:` now resolves against the release manifest published by the design system, not only the version list shipped inside the gem, so a framework version released after your trmnlp install can be pinned without upgrading. The manifest is read once per run with a 2 second timeout. If the request fails, or the response is not a version list, the copy bundled in the gem is used and rendering continues. That bundled copy is refreshed here too: `latest` moves from 3.1.1 to 3.2.0.
7
+ - `rake framework:sync` reads the published manifest by default. Pass a local design-system checkout (`rake framework:sync[/path/to/repo]`) for the previous behaviour.
8
+
4
9
  ## 0.10.0
5
10
 
6
11
  - Added support for the `description` plugin setting, an optional one-line summary of the plugin. `trmnlp init` scaffolds the key in `src/settings.yml`, `trmnlp lint` reports descriptions longer than 35 characters (the hosted service's limit), and `trmnlp list` shows a DESCRIPTION column when any plugin has one. Only the length is checked. Storing the value needs the matching hosted service release; until then `trmnlp push` drops it, because it rewrites the local `settings.yml` from the server's response.
data/README.md CHANGED
@@ -427,7 +427,7 @@ A complete worked example lives at [`examples/hn-stories/`](examples/hn-stories/
427
427
 
428
428
  The `settings.yml` file is part of the plugin definition, and is uploaded and downloaded by `trmnlp push` / `pull`.
429
429
 
430
- `framework_version:` pins the [TRMNL Design System](https://trmnl.com/framework) version this plugin renders against — `latest` (the default) tracks the newest release, or set a specific version for reproducibility. It lives here rather than in `.trmnlp.yml` so the value round-trips with the hosted plugin service.
430
+ `framework_version:` pins the [TRMNL Design System](https://trmnl.com/framework) version this plugin renders against — `latest` (the default) tracks the newest release, or set a specific version for reproducibility. It lives here rather than in `.trmnlp.yml` so the value round-trips with the hosted plugin service. The list of pinnable versions is read from the [design system's published manifest](https://github.com/usetrmnl/trmnl-framework) once per run, so a newly released version can be pinned without upgrading trmnlp. If that request fails, the copy bundled in the gem is used.
431
431
 
432
432
  `description:` is an optional one-line summary of the plugin, up to 35 characters. `trmnlp lint` reports anything longer, and `trmnlp list` shows it next to each plugin name.
433
433
 
@@ -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.1.1
3
+ latest: 3.2.0
4
4
  versions:
5
5
  - number: 0.0.1
6
6
  released_at: '2024-06-22'
@@ -70,3 +70,19 @@ versions:
70
70
  released_at: '2026-04-29'
71
71
  - number: 3.1.1
72
72
  released_at: '2026-05-01'
73
+ - number: 3.1.2
74
+ released_at: '2026-07-09'
75
+ - number: 3.1.3
76
+ released_at: '2026-07-14'
77
+ - number: 3.1.4
78
+ released_at: '2026-07-15'
79
+ - number: 3.1.5
80
+ released_at: '2026-07-16'
81
+ - number: 3.1.6
82
+ released_at: '2026-07-17'
83
+ - number: 3.1.7
84
+ released_at: '2026-07-18'
85
+ - number: 3.1.8
86
+ released_at: '2026-07-23'
87
+ - number: 3.2.0
88
+ released_at: '2026-08-03'
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'date'
4
+ require 'faraday'
3
5
  require 'yaml'
4
6
 
5
7
  module TRMNLP
@@ -11,10 +13,31 @@ module TRMNLP
11
13
 
12
14
  DEFAULT_ASSET_HOST = 'https://trmnl.com'
13
15
  DATA_PATH = File.expand_path('../../db/data/framework_versions.yml', __dir__)
16
+ # DATA_PATH holds a copy of this file, refreshed by `rake framework:sync`.
17
+ MANIFEST_URL = 'https://raw.githubusercontent.com/usetrmnl/trmnl-framework/main/db/data/framework_versions.yml'
18
+ MANIFEST_TIMEOUT = 2
14
19
 
15
20
  attr_reader :number
16
21
 
17
- def self.config = @config ||= YAML.load_file(DATA_PATH).freeze
22
+ def self.config = @config ||= (remote_config || YAML.load_file(DATA_PATH)).freeze
23
+
24
+ # Answers nil on any failure, so rendering never depends on the network.
25
+ # The shape check rejects error pages, which are also valid YAML.
26
+ def self.remote_config
27
+ response = Faraday.get(MANIFEST_URL) do |request|
28
+ request.options.open_timeout = MANIFEST_TIMEOUT
29
+ request.options.timeout = MANIFEST_TIMEOUT
30
+ end
31
+ return unless response.success?
32
+
33
+ # Release dates are quoted today, but the manifest is generated
34
+ # upstream and an unquoted date would otherwise be rejected here.
35
+ manifest = YAML.safe_load(response.body, permitted_classes: [Date])
36
+ manifest if manifest.is_a?(Hash) && manifest.key?('latest') && manifest.key?('versions')
37
+ rescue StandardError
38
+ nil
39
+ end
40
+ private_class_method :remote_config
18
41
 
19
42
  def self.version_numbers = config.fetch('versions').map { |v| v['number'] }.freeze
20
43
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TRMNLP
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.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.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rockwell Schrock