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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/db/data/framework_versions.yml +17 -1
- data/lib/trmnlp/framework_version.rb +24 -1
- data/lib/trmnlp/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: bdc22b090a3269c3fdbfa52287c287cbab548e6f40aa08428d037903f40dbb5b
|
|
4
|
+
data.tar.gz: 92886e598aa5e83e750bee7fdba8ee1b9d8b5f13fb6c021e2653cfa169900c44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
|
data/lib/trmnlp/version.rb
CHANGED