Skip to content

cli-v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Nov 02:59
· 71 commits to main since this release

Changed

  • The kinds are 0.1. A Lua app is shown at lua 0.1, pencere.version is the string
    "0.1", and a terminal that opens lua at another version is told so on standard error before
    the app's fallback runs: pencere: this program is written for lua 0.1; this terminal opens lua 0.2; update the older of the two. While the specification is a draft the versions of lua and
    web are 0.x: a change an existing view can notice moves the minor number (0.2 after 0.1),
    an addition does not, and a host opens one version. A program whose version the host does not open
    is not opened, and says so in a sentence that names both sides.

  • pencere test counts places as a script does: page:select, page:caret_to and the
    anchor and head of page:editor(name).selections are bytes of the text from 1, as
    layout.editor_text and an editor's events say them.

  • A page that fails is shown again, and the app goes on. pencere.serve shows a
    page that made an error, trapped or went over a limit once more from the start, silently, once in
    a minute (the page asks the app for where it was); ended = "error" now means that was given up
    on, because the failure came twice inside the minute or the terminal did not bring the view back.

  • A Lua app is shown at lua 0.1 alone. The kit has one version of the page API while the
    specification is a draft. A terminal that opens another finds no version in common.

Added

  • What a page prints is in the app's log. A page's print and warn are written where the
    app's own print goes (the terminal, --log FILE, .pencere/log under pencere dev), behind
    view: (and view: warning: for warn) so that the two are told apart. A failure of
    pencere test shows them with what the program printed. A control character in a line is written
    as \xNN.
  • pencere.serve refuses a calls or topics name that begins with pencere.: the names are the
    protocol's.
  • pencere.files.receive takes the path and the size the page was handed with a file, in its
    options: where the page passes them on, the file is copied from there rather than read through
    the terminal, which on the person's machine is as fast as the disk. The files-lua example's page
    passes them on.

Fixed

  • pencere upgrade works in a folder only the person can enter. It downloaded the release and
    its sums into pencere-upgrade-<pid> in the temporary directory, made if it was not there, so that
    a folder (or a link) another user had put there beforehand was written to and read back from. The
    folder is now made by mkdtemp: a name made up by the system, never one that can be made beforehand,
    new, with the mode 0700; the temporary directory itself is made first when TMPDIR names a folder
    that is not there.

  • pencere dev on a Cargo package leaves what its tools keep alone. It read every file of the
    project four times a second, and a directory it did not know by name, such as a .cache holding a
    checkout and its build, was read with the rest: a quarter of a core for as long as the pane was
    open. What is hidden, and target and node_modules at any depth, are now left out, so a save
    there no longer builds and runs the program again either.

  • pencere dev is left with ⌃C, as it says, and ends with 0: while the program runs, while Cargo
    builds it and while a change is waited for. It ended with the program's 130, or was killed by the
    signal while it waited, so make dev reported an error on every leaving.

  • The calls and the subscriptions of a view start in the order the view made them. Each came in on a
    thread of its own and raced the others to the app's loop, so that two edits the view sent one
    after the other could be begun the other way round; they are now handed to the loop as the view
    sends them (the program library's deferred handlers), and none waits for another's answer.

  • page:wait_for in pencere test goes on waiting when the page's view is over (the program closed
    it, showed another, lent the terminal), as what it waits for may be what the program does next:
    a program goes on after its serve on its own time, and the wait raised the view's end before
    the program had written what the test looked for. If the condition never comes the failure says
    the view is over.

Changed

  • The runner shows the views of the kit's page API at lua 0.1.
  • pencere.handoff is the pencere library's hand-off: the same serve shows the view again
    instead of a new one being started, the app's loop is no longer the one that waits for the view
    to give the terminal back, and a hangup while the program has the terminal is passed on to it
    and ends serve once it has ended. A change to the view's files under pencere dev while the
    program has the terminal is the view that comes back.

Added

  • Files with the view (pencere.files, a terminal that opens lua 0.1): attach and
    attach_data give the view a file to draw and return its name, detach lets it go, receive
    takes a file the person gave the page by its handle (through a .pencere-part that is deleted when
    it is not finished), send writes a file to the place the person chose in the Save panel, and
    safe_name makes the person's name one a path can take. Each waits without holding the loop; a
    failure is { code =, message = }. Apps offer lua 0.1. pencere test plays the
    person's files: give_files, drag_files_over, drag_files_away, panel, choose_files,
    choose_place, and test.open{ attach = { bytes } }. The example files-lua shows them.

  • pencere test says how the host draws its terminal's cursor and selection (terminal_look, draws
    of test.open; page:set_terminal_look(table) changes it, and the page is told).

  • pencere test can dwell(id, x, y) (the pointer rests over a word of an editor that hears of it,
    as long as it takes to be told), hold("cmd"), release() and click_holding(x, y, "cmd") (the modifiers a person holds) and say where a range the page named is (anchor_rect(editor, name)).

  • PENCERE_CALL_MS for pencere test. The time, in milliseconds, a call of the page may take
    in a test: the floor's 250 ms (the least a host gives a page) unless it is set. The limit is the wall
    clock's, and a test of what a page shows and does should not fail for how quick a busy runner is;
    a value that is not a whole number above zero is not read.

  • pencere test. Runs the tests of an app, written in Lua (test/**/*_test.lua,
    require("pencere.test")), against the page of the app under a host with no screen: its page
    engine, editors and interpreter, with a clock the test moves. The page's program is a stand-in
    made of calls the test answers, the app's own program (Lua, in the test's process, in an
    environment of its own; a Cargo package, built once and run on a pty) or any program on a pty.
    Things are found by their words and their role, the test looks with expect, and a failure says
    what the page showed and keeps its picture, its words and its messages. The files run on worker
    processes (--jobs), a test is cut off at its timeout, and the report is pretty, TAP or JUnit.
    The runner of tests, pencere-test, is a program of its own and a second file of the release:
    the command runs the one beside it, or the release's of the same version (checked against its
    SHA256SUMS, kept in the cache), or the one PENCERE_TEST names. pencere new makes the first
    test (Lua and Rust projects; TypeScript with --page lua), and a simple-form app does not pack
    test/ (a program module of that form cannot live in a directory of that name).

  • pencere new --lang ts --page lua. A TypeScript project whose view is a page of the kit,
    the Lua project's page, with its first test.

  • pencere upgrade. Replaces the command with the newest release of it, as install.sh would
    install it: the release's file for this machine, checked against the release's SHA256SUMS, put
    in the place of the running file in one rename. --check only says whether there is a newer one,
    --version X.Y.Z takes that one (an older one too). A command Cargo installed is left to Cargo,
    with the line that replaces it.

  • pencere dev and pencere build for a program in Rust. In a Cargo package, pencere dev
    builds the program with Cargo and runs it in the pane: a change to the page or a picture shows
    the view again without ending it (the pencere library reads them from the project), and a
    change to anything else builds and runs it again; the program's standard error goes to the log.
    pencere build builds it with cargo build --release (--target passed on, with what to install
    when the toolchain lacks it) and copies it to dist/<name>.

  • pencere new --lang rust makes a project whose build script carries src/view/ and
    src/assets/ into the program (pencere::app!()), so the page can be split into files as a Lua
    app's is. It needs the pencere crate that has App: the release that ships this command sets
    the version of the crate in the template to it.