Commit Graph
131 Commits
Author SHA1 Message Date
Ikraam Ghoor 0d9fa1c678 Updated version to 0.8.9
Releases the Podman container bind fix. The release workflow tags and
publishes when lib/trmnlp/version.rb changes on main, so this bump ships
the gem and Docker image that carry the fix.
2026-06-29 16:57:09 +02:00
Ikraam Ghoor 90aea932eb Fixed Podman container bind detection
The serve command auto-binds to 0.0.0.0 inside containers so the dev
server is reachable through published ports. Detection only checked
for /.dockerenv, which Docker writes but Podman does not. Under Podman
serve fell back to 127.0.0.1 and was unreachable from the host, as
reported in issue #112.

Detection now also checks for /run/.containerenv, which Podman writes,
so the auto-bind works for both runtimes with no extra flags.

Also dropped the bin/trmnlp wrapper change that appended --bind 0.0.0.0
to every command. The flag was added after "$@", so it landed on build,
login, and init too, none of which accept --bind, and Thor errored. The
container auto-detect makes the wrapper flag unnecessary.
2026-06-29 16:53:25 +02:00
Ikraam GhoorandGitHub 2ec6bc935e Fix login --server crash on scheme-less URLs (#114)
* Fixed login --server crash on scheme-less URLs

Necessary to keep `trmnlp login --server` from crashing when given a
scheme-less URL such as localhost:3000, which URI.parse leaves with a
nil host.

The trmnl.com check now lives on Config::App#trmnl_host?, beside the
base_uri it reads, so the command no longer reaches into URI internals
and the nil host is guarded in one place.

Specs drive the subject through a single let(:server), drop an example
that duplicated the existing user_ rejection, and add coverage for the
declined re-authentication and scheme-less server paths.

* Updated version to 0.8.8

Necessary to release self-hosted (BYOS) login support: the `trmnlp
login --server` flag, acceptance of non-trmnl.com token formats, and
listing of plugins with a nil plugin_id.
2026-06-23 17:53:24 +01:00
8166f4e46a Make server base url configurable for BYOS support (#113)
* feat(trmnlp): add Config::App#base_url= writer

Implement a writer method for Config::App that persists the base_url to
the @config hash, enabling the save method to persist it to disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(trmnlp): add --server flag to login; accept Sanctum tokens for non-trmnl.com servers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: base guard on effective base_uri, not presence of --server flag

Remove `options.server.nil? &&` from the user_ prefix guard so that
the check is based on where the request will actually go (the persisted
base_uri) rather than whether --server was passed in the current
invocation. Update the --server spec examples to let base_url= execute
for real and assert via base_uri instead of a stub.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(trmnlp): show plugins with nil plugin_id in list command (LaraPaper support)

Allow list command to display plugins where plugin_id is nil, supporting LaraPaper's plugin format while maintaining backward compatibility with existing plugin_id filtering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix linjts

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 17:47:24 +01:00
Stephen YearginandGitHub 273f1fb415 Fix .trmnlp.yml overrides (#111)
Fix .trmnlp.yml overrides
2026-06-05 12:59:37 +01:00
Ikraam Ghoor 4185f312c3 Cleaned up form_fields.yml and bumped version to 0.8.6 2026-06-04 06:59:51 +02:00
Ikraam Ghoor 9039fd956d Updated version to 0.8.5
Necessary to release the Liquid filter fix from #105. The Release
workflow tags and publishes the gem when version.rb changes on main;
Gemfile.lock and the changelog move in lockstep.
2026-05-23 05:04:23 +01:00
Stephen Yeargin e481401e8d Stub TRMNL::Liquid::RailsHelpers when ActionView is unavailable 2026-05-22 20:48:57 -05:00
Ikraam Ghoor 4489adf021 Updated version to 0.8.4
Necessary to release the live-reload, shutdown, and transform fixes.
The Release workflow tags and publishes the gem when version.rb
changes on main; Gemfile.lock and the changelog move in lockstep.
2026-05-20 14:02:20 +01:00
Ikraam Ghoor 8fd6ea14c7 Fixed live-reload, shutdown, and transform bugs
Necessary because once multiple browser tabs were open, live-reload
parked Puma worker threads on queue.pop and exhausted the pool. The
route now hands the socket off via rack.hijack so the worker
returns immediately, and Puma's pool is bumped to 1:16 for headroom
on parallel page+render requests.

Filewatcher 3.0.1's #watch installs trap('INT') { exit }, which
clobbered Puma's clean-shutdown handler and made Ctrl-C take three
presses to exit. A Module#prepend on the gem skips the trap loop.

The scaffold's settings.yml ships with `serverless_language: ''`,
which `|| inferred_language` treated as truthy (empty string is
truthy in Ruby) so every transform reported `unsupported language:`
with empty interpolation. The config reader now collapses empty
strings to nil.
2026-05-20 13:58:21 +01:00
Ikraam Ghoor cd79062d4d Added git-ready CI scaffold to init and clone
Necessary so a new plugin is immediately ready to push to GitHub and
deploy on every commit to main. Init and clone now drop a CI workflow
and .gitignore, and run `git init -b main` so the scaffold lands on
the branch the workflow expects. The Docker image now includes git
for the `docker run trmnl/trmnlp clone` flow. View templates ship
canonical layout + title_bar markup. Use --skip-git to opt out.
2026-05-20 11:50:50 +01:00
Ikraam Ghoor 75020ed42c Updated version to 0.8.2
Necessary to release the framework version fix. The Release
workflow tags and publishes the gem when version.rb changes on
main; Gemfile.lock and the changelog move in lockstep.
2026-05-19 11:45:25 +01:00
Ikraam Ghoor 421254bf01 Fixed framework version always tracking latest
An unpinned plugin rendered against the auto-upgrading /latest/
asset path instead of a concrete release, so the local preview
drifted from the hosted service whenever a new framework version
shipped. Both now resolve to the same pinned version number.
2026-05-19 11:45:25 +01:00
Ikraam Ghoor eff9a132cc Updated inaccurate comments and help text
A repo-wide audit of comments against the code surfaced four spots
where the words drifted from the behavior:

- user_data_assembler.rb: the post-transform namespace re-application
  comment listed device/user/plugin_settings but omitted system; the
  code restores the whole trmnl namespace.
- renderer.rb: the TemplateBinding comment pointed at the app.rb
  render route, but the binding's ivars actually feed
  web/views/render_html.erb.
- waits_for_dom_load.rb: the lint message named only window.onLoad(),
  though the check also flags window.addEventListener("load").
- cli.rb / README.md: --color_depth advertised "1, 2, or 4" while
  ImageQuantizer accepts 1-8.

Text-only; no behavior change.
2026-05-19 11:29:55 +01:00
Ikraam Ghoor a2eb862f7f Fixed ImageLinksReachable skipping shared markup
ImageLinksReachable scanned `source.view_markup` — the four per-view
templates — so a static <img> with a broken URL in the plugin's
shared markup passed the lint check undetected.

Every other markup check (LimitedInlineStyles, NoSizeClasses,
NoAsyncFunctions, NoOpacity) reads `source.all_markup`, which is view
markup plus shared markup. ImageLinksReachable was the lone outlier;
nothing documented the exclusion as intentional, and a broken image
is a defect regardless of which file the tag lives in.

Switched to `all_markup` so shared-markup image links are checked
too. The spec's source double now stubs `all_markup`, which fails
loudly if the check regresses to `view_markup`.
2026-05-19 11:29:55 +01:00
Ikraam Ghoor 31e252cbd0 Updated Wrapper parity comment for PHP tag
Wrapper claimed it mirrors the hosted serverless runtime "verbatim
except for the configurable sink." True for node, python, and ruby —
but Wrapper.php also prepends a leading `<?php` tag the hosted
wrapper omits.

The tag is deliberate: the file-based Subprocess path runs the
wrapped code as a real .php file, inert without it, and the daemon
tolerates the extra tag. The behavior is correct; the comment
overstated parity. Spelled out the PHP difference so the comment
can be trusted.
2026-05-19 11:29:55 +01:00
Ikraam Ghoor 7a66bd18a2 Removed dead output fallback from Http backend
TransformBackend::Http#parse fell back to `stdout` when the daemon
response lacked an `output` field, ostensibly for older daemons
predating the separate output channel.

The fallback could never produce a correct result. Every released
transform daemon emits `output`, so it never triggers against a real
daemon. The only daemon that lacked `output` also never read FD 3 —
and the Http backend writes the transform result solely to FD 3 — so
that result was discarded on the wire while `stdout` held only user
debug prints. The fallback guarded a daemon shape that never shipped.

Read `output` directly: it is honest about the actual contract.
2026-05-19 11:29:55 +01:00
Ikraam Ghoor 13ffd1771d Updated documentation and bumped version to 0.8.1
Necessary to ready the 0.8.1 release. The changelog records the new
build --png command, the payload-size colour coding, the coloured
CLI output, and the init and polling fixes. The README documents how
to drive the build command and notes the SimpleCov coverage report.
2026-05-18 21:51:51 +01:00
Ikraam Ghoor c1b155645a Added size and depth flags to build --png
build --png always rendered at 800x480 with the bit depth sniffed
from the markup, with no way to override either. The serve command's
PNG route already accepts width, height, and color_depth as params.

build now takes --width, --height, and --color-depth, threading them
through the same ScreenGenerator the route uses. --color-depth
overrides the screen--Nbit markup sniff; an omitted flag leaves the
existing default in place.
2026-05-18 21:51:51 +01:00
Ikraam Ghoor 1ad1109044 Removed the tone gem dependency
The Reporter used exactly two things from tone: a colour helper and
terminal detection. Earning those pulled tone, zeitwerk, and
refinements into the dependency tree of a gem users install.

A four-line hand-rolled colorizer covers both — the same ANSI codes,
suppressed off a terminal. The Reporter specs pass unchanged because
they assert on output, not on the colour library, so the swap carries
no behaviour change.
2026-05-18 21:51:51 +01:00
Ikraam Ghoor 681ac31a4f Added TTY-aware colour to terminal output
The Reporter hand-rolled ANSI escape codes and emitted them
unconditionally, so colour leaked into piped or redirected output as
unreadable escape sequences. Colour was also limited to the lint
summary.

Output now routes through the tone gem, which suppresses ANSI when
the stream is not a terminal. Colour extends to the warnings the
poller and form-field validation emit, and to the error the
executable prints on a fatal failure.
2026-05-18 21:51:51 +01:00
Ikraam Ghoor 3a47778abe Added a --png flag to the build command
trmnlp build only produced HTML, so seeing a plugin as it renders on
e-ink meant booting the serve command. build --png now screenshots
each view through the existing quantization pipeline and writes a
1-bit PNG alongside the HTML.

The headless Firefox factory that powers the screenshots was private
to the serve command. With build as a second consumer it moves to a
shared FirefoxDriver module rather than being duplicated.
2026-05-18 21:51:51 +01:00
Ikraam Ghoor 175333de70 Fixed non-JSON poll responses exposed under the wrong key
A text/html or text/plain polling response that is not secretly JSON
was exposed to the template as {{ text }}. The hosted service exposes
the same body as {{ data }}. A plugin author writing Liquid against
production and previewing locally would find their template empty
with no error to explain it. The poller now uses {{ data }} to match.
2026-05-18 17:26:37 +01:00
Ikraam Ghoor cbf2b9928c Added colour coding to the payload-size badge
The preview already displayed the merge-variable payload size, but as
plain text — an author had no at-a-glance signal that a payload was
approaching the size the hosted service starts rejecting. The badge
now turns yellow from 75 KB and red from 100 KB, so an oversized
payload is obvious before the plugin misbehaves in production.
2026-05-18 17:25:49 +01:00
Ikraam Ghoor 9cc96c96de Fixed init creating read-only project files
FileUtils.cp preserves the source file mode. When trmnlp is installed
into a read-only location — NixOS stores gems under /nix/store with
0444 permissions — init produced project files the author could not
edit. The copy now adds owner-write while keeping any executable bit,
so a freshly initialised plugin is always editable.
2026-05-18 17:21:37 +01:00