trmnlp-test 0.1.4 → 0.1.6
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/README.md +24 -2
- data/lib/trmnlp_test/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: 76c4c9668d38f2948059d9abadd85fc18121a67be4ae4a72889f225ca883f9ec
|
|
4
|
+
data.tar.gz: 3d6c6611a7ec0722069a7e57c450f275284a9e93125b89e5f3ab7b8365744639
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d7dda07705cecae1978bb51d2c9629c594ec98c13fc79e35971c24defaa4875f8d5f74c289e172ccd5976d3644e412c1106e69372a672446637258e162447ea
|
|
7
|
+
data.tar.gz: 34a7f209884667feeedcd8370c1f14984d4edde7c60c19ceb2f95bb21142d39462c50fb442159695b7545d0d8785dda246483c5e362d530328928b6b8b00c1a1
|
data/README.md
CHANGED
|
@@ -36,6 +36,23 @@ From a clone, `bin/trmnlp-test` builds the image from source on the newest trmnl
|
|
|
36
36
|
|
|
37
37
|
Pushing to `main`, and a daily check for a new trmnlp release, publish the image as `:latest` and `:trmnlp-X.Y.Z`. Pushing a tag `vX.Y.Z` (matching `lib/trmnlp_test/version.rb`) runs the self-tests, publishes `:X.Y.Z` and pushes the gem through rubygems.org trusted publishing (no stored key).
|
|
38
38
|
|
|
39
|
+
## GitHub Actions
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
# .github/workflows/trmnl-tests.yml (trmnlp-test init writes it)
|
|
43
|
+
name: trmnl tests
|
|
44
|
+
on: [push, pull_request]
|
|
45
|
+
jobs:
|
|
46
|
+
test:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
- uses: ExcuseMi/trmnlp-test@v0
|
|
51
|
+
# with: { args: '--workers 2', directory: '.', report: 'test/trmnl-report', version: '', artifact: 'trmnl-report' }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It installs the gem, caches `~/.cache/trmnlp-test`, runs the tests, writes a summary on the run page, adds annotations at the failing lines, and uploads the report with every device picture as the `trmnl-report` artifact. Commit PNG snapshots (`__screens__/`) so `toMatchScreen` has something to compare against.
|
|
55
|
+
|
|
39
56
|
## Config: `trmnlp-test.config.js`
|
|
40
57
|
|
|
41
58
|
See [templates/trmnlp-test.config.js](templates/trmnlp-test.config.js). Transform dependencies:
|
|
@@ -55,7 +72,8 @@ test('menu', async ({ trmnl }) => {
|
|
|
55
72
|
const screen = await trmnl.render({
|
|
56
73
|
device: 'og_plus', view: 'full', // any model, orientation: 'portrait', palette, theme, scale, textScale, fonts, framework
|
|
57
74
|
darkMode: true, // as the server does it: everything inverted except images ('framework': the v3 class only)
|
|
58
|
-
|
|
75
|
+
qr: 'server', // qr_code as TRMNL's server returns it (default); 'trmnlp', 'fixed'
|
|
76
|
+
crlf: true, // the template with CR LF newlines, as TRMNL's web editor preview had it
|
|
59
77
|
fields: { data_source: 'webhook' }, // custom field values (defaults + .trmnlp.yml + these)
|
|
60
78
|
webhook: { merge_variables: {...} }, // or data: {...} to render given data as is
|
|
61
79
|
mocks: { 'https://api.example.com/*': { temp: 21 } },
|
|
@@ -92,7 +110,11 @@ for (const s of matrix({ device: DEVICES.representative, view: VIEWS, darkMode:
|
|
|
92
110
|
}
|
|
93
111
|
```
|
|
94
112
|
|
|
95
|
-
**Where
|
|
113
|
+
**Where TRMNL differs from trmnlp.** trmnlp-test renders with trmnlp's code, except where TRMNL is known to differ (observed on trmnl.com, 2026-10-02):
|
|
114
|
+
|
|
115
|
+
- `qr_code`: the server ignores the view argument and returns the viewBox plus the code's natural width/height and `style="max-width:100%;height:auto"`, so a code only shrinks, never grows (a 25-module code stays 275 px in a bigger box), and a second width added by the template makes the SVG invalid XML inside an `<img>`. This is the default; `qr: 'trmnlp'` renders trmnlp's scalable SVG, `qr: 'fixed'` one without a viewBox (not observed, for robustness). `matrix({ qr: QR_MODES })` covers all three.
|
|
116
|
+
- Dark mode: `darkMode: true` inverts the whole screen except images, as TRMNL describes it and the server preview showed for an inline SVG on framework 3.4. Not yet confirmed on a device for v3. `darkMode: 'framework'` renders the v3 class only, which leaves inline SVG and hard-coded colours as they are.
|
|
117
|
+
- `crlf: true` (not the server: TRMNL's web editor preview) turns the template's newlines into CR LF, so a newline typed in the template no longer matches `\n` in data.
|
|
96
118
|
|
|
97
119
|
Other helpers: `trmnl.plugin('other/dir')`, `trmnl.lint()` with `toPassLint({ allow })`, `FRAMEWORK.majors()`, `FRAMEWORK.latestOf('2')`.
|
|
98
120
|
|
data/lib/trmnlp_test/version.rb
CHANGED