trmnl_preview 0.25.0 → 0.27.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 +14 -0
- data/README.md +24 -18
- data/db/data/framework_prefixes.yml +1258 -0
- data/lib/trmnlp/cli.rb +2 -0
- data/lib/trmnlp/lint/checks/custom_field_links_embedded.rb +35 -0
- data/lib/trmnlp/lint/checks/files_under_upload_limit.rb +22 -0
- data/lib/trmnlp/lint/checks/framework_classes_exist.rb +19 -3
- data/lib/trmnlp/lint/checks/framework_prefixes_exist.rb +80 -0
- data/lib/trmnlp/lint/checks/webhook_url_shown.rb +24 -0
- data/lib/trmnlp/lint/diagnostic.rb +10 -2
- data/lib/trmnlp/lint/source.rb +6 -0
- data/lib/trmnlp/lint.rb +9 -1
- data/lib/trmnlp/version.rb +1 -1
- data/templates/init/bin/trmnlp +3 -2
- data/templates/run_in_docker +1 -0
- metadata +6 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ddab525950f3e01ae9fd4e07afb80de6561f5c88f5f5a307f46c2578f057c4fa
|
|
4
|
+
data.tar.gz: 38563769627d50fae1b5f3aee125a99f1661ebb703655adc5cce7133e5371d85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63e93e72f98d094dc6630394a968d30bca3020fc5938f32654b1b3c7c55fad6aa5456ba25c184c12ebfa1a7f0a9ffcb3efd55d1f3699a1a7ae18dbffc8e3ee4c
|
|
7
|
+
data.tar.gz: ac550f4ff63967bd8a4a47e7923919ffa889332706e99129e7e454df4065c303d34d6a7d572321234c435ab301c630cb3085647722b56e52ba1c9bad704773e0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
# Changelog
|
|
3
3
|
|
|
4
|
+
## 0.27.0
|
|
5
|
+
|
|
6
|
+
- `trmnlp lint` reports a webhook recipe with no `copyable_webhook_url` custom field (`webhook_url_shown`), as TRMNL's recipe review does. Without it, people who install the recipe have no field to copy their webhook URL from.
|
|
7
|
+
- A release pinned in a plugin's `bin/trmnlp`, such as `IMAGE=trmnl/trmnlp:v0.24.0`, is used when another copy of the script is on the PATH as `trmnlp`. The plugin ran the PATH copy's image instead. To get the fix in an existing plugin, run `trmnlp init` there and overwrite only `bin/trmnlp`.
|
|
8
|
+
- `trmnlp version` says when it runs in Docker, and in which image, on a second line on stderr. The version stays alone on stdout.
|
|
9
|
+
|
|
10
|
+
## 0.26.0
|
|
11
|
+
|
|
12
|
+
- `trmnlp lint` names the sizes an element has when a size class is missing (`framework_classes_exist`), such as `title--small` to `title--xxlarge` for `title--mega`, and links to the Framework's Element Sizes page. Each element has its own set of sizes.
|
|
13
|
+
- The `hn-stories` example uses `title--small` in its half views. It had `title--xsmall`, which no Framework release has, so those titles rendered at the default size.
|
|
14
|
+
- `trmnlp lint` reports a Framework class behind screen prefixes that its release does not define for it (`framework_prefixes_exist`): a prefix that does not exist, such as `xl:value--large`, prefixes out of order, such as `portrait:lg:value--large`, or a prefix the class has no variant for, such as `dark:value--large`. TRMNL ignores the class and says nothing. The lists come from each release's `plugins.css`; `rake framework:classes` refreshes them.
|
|
15
|
+
- `trmnlp lint` reports a plain `https://` link in a custom field's description (`custom_field_links_embedded`), as TRMNL's recipe review does. An embedded `<a>` link is shorter, opens in a new tab and is plainly clickable; a link written without `https://` stays an unlinked example.
|
|
16
|
+
- `trmnlp lint` reports a `settings.yml`, view or transform over 100 KB (`files_under_upload_limit`). TRMNL refuses to import such a file, so `trmnlp push` failed, even when a transform trims the data and the plugin renders in `serve`. Thanks to @barrymichaeldoyle for #252.
|
|
17
|
+
|
|
4
18
|
## 0.25.0
|
|
5
19
|
|
|
6
20
|
- `trmnlp lint` also reports a `content--` class that the plugin's Framework release does not have (`framework_classes_exist`), such as `content--xsmall`. Rich Text sizes stop at `content--small`, and a missing one leaves the text at the default size.
|
data/README.md
CHANGED
|
@@ -13,16 +13,18 @@ The server watches the filesystem for changes to the Liquid templates, seamlessl
|
|
|
13
13
|
|
|
14
14
|
## Quick Start
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
With [Docker](https://docs.docker.com/get-docker/) installed:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
|
|
19
|
+
mkdir -p ~/.local/bin # install
|
|
20
|
+
docker run --rm --entrypoint cat trmnl/trmnlp /app/templates/init/bin/trmnlp > ~/.local/bin/trmnlp
|
|
21
|
+
chmod +x ~/.local/bin/trmnlp
|
|
20
22
|
trmnlp init my_plugin # scaffold a project
|
|
21
23
|
cd my_plugin
|
|
22
24
|
trmnlp serve # preview at http://localhost:4567
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
Have Ruby 4.0 or newer? `gem install trmnl_preview` starts faster — see [Installing via RubyGems](#installing-via-rubygems).
|
|
26
28
|
|
|
27
29
|
## Project Structure
|
|
28
30
|
|
|
@@ -227,21 +229,7 @@ The `bin/trmnlp` script is provided as a convenience. It will use the local Ruby
|
|
|
227
229
|
|
|
228
230
|
You can modify the `bin/trmnlp` script to set up environment variables (plugin secrets, etc.) before running the server.
|
|
229
231
|
|
|
230
|
-
**
|
|
231
|
-
|
|
232
|
-
### Installing via RubyGems
|
|
233
|
-
|
|
234
|
-
Prerequisites:
|
|
235
|
-
|
|
236
|
-
- Ruby >= 4.0
|
|
237
|
-
- For PNG rendering (optional):
|
|
238
|
-
- Firefox
|
|
239
|
-
- ImageMagick
|
|
240
|
-
|
|
241
|
-
```sh
|
|
242
|
-
gem install trmnl_preview
|
|
243
|
-
trmnlp serve
|
|
244
|
-
```
|
|
232
|
+
**Docker or gem?** The Docker image has everything trmnlp needs, including Firefox and the tools `trmnlp test` uses. The gem starts a little faster, but needs Ruby 4.0 and those tools installed yourself.
|
|
245
233
|
|
|
246
234
|
### Installing via Docker
|
|
247
235
|
|
|
@@ -328,6 +316,24 @@ cd trmnlp
|
|
|
328
316
|
docker build -t trmnlp .
|
|
329
317
|
```
|
|
330
318
|
|
|
319
|
+
### Installing via RubyGems
|
|
320
|
+
|
|
321
|
+
Prerequisites:
|
|
322
|
+
|
|
323
|
+
- Ruby >= 4.0
|
|
324
|
+
- For PNG rendering and `trmnlp test`:
|
|
325
|
+
- Firefox
|
|
326
|
+
- ImageMagick 7
|
|
327
|
+
- For some `trmnlp test` features ([Testing](docs/testing.md)):
|
|
328
|
+
- libfaketime, for a transform's clock with `now:`
|
|
329
|
+
- zbar, for `have_qr_code`
|
|
330
|
+
- Node 24, Python or PHP, for a transform in that language
|
|
331
|
+
|
|
332
|
+
```sh
|
|
333
|
+
gem install trmnl_preview
|
|
334
|
+
trmnlp serve
|
|
335
|
+
```
|
|
336
|
+
|
|
331
337
|
## `.trmnlp.yml` Reference - Project Config
|
|
332
338
|
|
|
333
339
|
The `.trmnlp.yml` file lives in the root of the plugin project, and is for configuring the local dev server.
|